-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TagInput: Part 2 - Keyboard Navigation #3894
Open
Gazook89
wants to merge
10
commits into
naturalcrit:master
Choose a base branch
from
Gazook89:TagInput-Part-2-Keyboard-Nav
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
TagInput: Part 2 - Keyboard Navigation #3894
Gazook89
wants to merge
10
commits into
naturalcrit:master
from
Gazook89:TagInput-Part-2-Keyboard-Nav
Conversation
This file contains 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
Removes a lot of abandoned styling, and sets a baseline for the remove buttons and the list in general.
Add a state variable for managing focus. From prior element, tabbing into the TagInput puts the focus on the "new tag" input. From there, shift-tabbing brings focus back through the existing tags starting from last and going to first. From first tag, shift-tabbing moves focus to prior element outside TagInput. Focus can be moved forward via just `tab`. Added some styling for focus states, including a small change to the thumbnail URL button for consistency.
Add options for: - arrow key and tab navigation, - 'Enter' or 'Space' to edit a tag - 'Enter', 'Tab', or ',' to submit a new tag - 'Escape' to exit a tag without submitting - 'Delete' to delete a tag Tabbing from outside the component sends focus to the new tag input, from which you can shift-tab or arrowLeft to move focus through the tags. Tabbing or shift-tabbing through the last tag or past the new tag input sends focus out of the component to wherever the next focus point is.
13 tasks
5e-Cleric
added
feature
UI/UX
User Interface, user experience
🔍 R_ - Not ready for review 🕑
labels
Dec 26, 2024
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.
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