TagInput: Part 2 - Keyboard Navigation #3894
Open
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.
Description
This portion mostly focuses on improving keyboard navigation of the TagInput elements.
You should be able to
tab
through the Properties Editor across inputs, jumping to the "new tag" input when you hit the TagInput component. Furthertab
ing moves you past the TagInput.If the "new tag" input is focused, you can use the arrow keys to move back or forwards through the tags/new input, and it should trap focus inside the component when using arrow keys-- it currently does not*.
You can also
tab
/shift tab
to move through the tags/new input, and this does not trap focus inside the component.enter
on a tag opens it for editing or submits it if currently editing,esc
closes it without saving,,
submits a change if editing,tab
moves focus out while keeping it open for editing.Related Issues or Discussions
QA Instructions, Screenshots, Recordings
Use keyboard to navigate through the TagInput and see if it's intuitive. If you want to go deeper, I'm sure this could be improved with a closer look at WCAG guidelines, though I did try to follow it pretty closely.
Reviewer Checklist
*Reviewers, refer to this list when testing features, or suggest new items *
tab
into the component from either before or after the component focuses the 'add tag' inputenter
or,
in the 'add tag' input submits a new tagshift tab
from 'add tag' input moves focus through tags starting from end, and escapes the component entirely from the first tagtab
, when focus is already inside the tag list, moves the focus through tags and escapes the component entirely from the 'add tag' input.enter
on a tag opens it for editing, and submits it if already open for editingesc
on edited tag cancels the edit and closes the input,
on edited tag submits it (likeenter
)arrow keys
move focus between tabs but does not escape the component when it reaches the endsCopy this list