-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(listbox-popover): Tab stop for search #1097
feat(listbox-popover): Tab stop for search #1097
Conversation
When the listbox is shown, the focus should be on the search box, it will be in other PRs? |
I don't think we've discussed that. We only needed to have a tab stop for search field. Is that some new requirement that I'm missing maybe? |
I think that would be nice, since you press "search" to open it. It is also the way it works with the old table |
then i think that should come as an option to the popover, because we can have popover on a button which we may not want to have it focused by default (mash up example), will update the pr soon |
@Caele thoughts on this? |
I would say that this is actually the correct behaviour from accessibility perspective. The real issue is probably the design of the popover. We actually faced the same issue with the old table before. If you focus the search field directly how would you know that you have skipped some buttons? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work nicely I think. But what Niek mentioned might need some extra stuff, to make sure the user understands that focus shifted.
Yes, I think that requires some design discussions and thinking deeply about what we might take action on it (another PR after we have concrete decisions on it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍 Would be nice to update the description as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Niek says, the problem is already there in the old listbox. Since it is not really a downgrade, but rather aligning the new and the old, I don't think we have to consider it in this PR.
…tm/listbox-popover-tabstop-for-search
46a6b24
to
99ecd50
Compare
…tm/listbox-popover-tabstop-for-search
@@ -35,6 +35,7 @@ export default function ListBoxPopover({ | |||
app, | |||
fieldName, | |||
stateName = '$', | |||
autoFocus, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autoFocus, | |
autoFocus = true, |
and can remove the ?? below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can, but saw this comment after merge, sorry 😅
Motivation
we need to have a tab stop in search field in sn-table side according to our a11y standards. Since we can't use the
useKeyboard ()
hook directly inside of nebula, we need to mimic it's return values and in this case passing{ enabled: false }
intoListBoxSearch
as keyboard prop does the job for us!Screen.Recording.2023-03-02.at.09.54.26.mov
Screen.Recording.2023-03-02.at.09.57.26.mov
Update:
now the logic updated and:
(NOTE: 👆that is only for popover mode!)
Requirements checklist
yarn spec
When build and tests have passed: