Use Up and down arrow keys in note field to select notes#10597
Merged
riknoll merged 3 commits intomicrosoft:masterfrom May 23, 2025
Merged
Conversation
riknoll
requested changes
May 22, 2025
pxtblocks/fields/field_note.ts
Outdated
| }; | ||
|
|
||
| protected widgetDispose_(): void { | ||
| this.htmlInput_.addEventListener("keydown", this.keyHandler); |
Member
There was a problem hiding this comment.
should this be removeEventListener?
Contributor
Author
There was a problem hiding this comment.
Oops, yes it definitely should! Fixed.
riknoll
approved these changes
May 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable the user to select a note value via the keyboard using the up and down arrow keys.
Screen.Recording.2025-05-20.at.09.57.01.mov
This is an unusual field for keyboard navigation because the Block's "frequency" input remains focused rather than moving focus to the piano view as an editor would. To make the piano view into a separate keyboard-navigable widget would be a larger piece of work. I suggest this as a pragmatic improvement that improves accessibility and makes the editor more engaging to keyboard users without otherwise changing the note field.
Live demo: https://note-field-keyboard-accessib.review-pxt.pages.dev/
Testing