microsoft / microsoft/pxt-microbit

Keyboard navigation glitch when using mouse to click outside injection div during field edit

Open
#6,461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

keyboard navigation P2
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Describe the bug

There's a keyboard navigation glitch when using mouse to click outside injection div during a field edit (i.e. with widget or dropdown focused) and then tabbing back to the toolbox or workspace.

In this scenario keyboard navigation doesn't work properly.

If you click in the workspace, use the area menu or close the toolbox with escape after tabbing to it everything works again.

We tried to fix this for the 12.2.0 Blockly release but it introduced more serious issues for keyboard only users so we've had to back away from it for now.

To Reproduce

  1. Edit a field but do not confirm/cancel (e.g. leave dropdown open or input focused)
  2. Click in whitespace below the simulator
  3. Tab back to the toolbox
  4. Try to access the flyout via keyboard, note it doesn't work
  5. Click in the workspace or Escape to close toolbox, everything works again.

Expected behavior
We think the dropdown and widget should close when clicking outside the injection div, just like they do when clicking on empty space inside the workspace.

Blockly agree and tried to make a change for 12.2.0. Unfortunately this broke scenarios in MakeCode that use both the widget and dropdown div. See https://github.com/google/blockly/issues/9221 so the released 12.2.0 does not include this change.

There are potential workarounds in MakeCode, see the hideChaff suggestion under "Potential solutions". I don't think we should attempt them for Friday but potentially as a subsequent fix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sequence involving an unfinished field edit, a click below the simulator, and tabbing back to the toolbox. Trace the injection div, widget/dropdown, toolbox, and workspace focus handling, then review the related Blockly issue 9221 and the hideChaff suggestion. Done means outside clicks close the widget or dropdown without breaking keyboard-only users or scenarios using both widget and dropdown divs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.