-
Notifications
You must be signed in to change notification settings - Fork 76
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
Bug: calcite-popover - trap focus inside #2133
Comments
Follow |
(1) and (2) are fixed with the use of the new |
@AdelheidF can you put together a codepen that illustrates this bug? Thanks! |
https://codepen.io/afreitag/pen/LYjmaWv?editors=1000 Click on the button to open the popover. Wait until focus sits on close button, now tab 4 times, all good. Now tab one more time, the focus should go back to the close button. How can I know that the focus left the list to set it back to the close button? A keyboard-only user would be lost now. |
Is this specific to list? Looking at it now it just seems like we don't trap focus inside a popover. That seems like a reasonable thing to have support though. |
not really, |
@jcfranco should we use this npm package for this? https://www.npmjs.com/package/focus-trap We could update the modal to use this package too. |
…y. (#5725) * refactor(modal): Update modal to use focus-trap module. * cleanup * cleanup * fix test * cleanup * cleanup * remove `previousActiveElement` internal prop. focus utility handles this already. * set fallbackFocus element. * feat(popover): Add focus-trap to popover. #2133 * cleanup * cleanup * cleanup * add disableFocusTrap prop to popover * review feedback * add spec test * revert changes * add popover tests for setFocus
Installed and assigned for verification. |
All 3 sub-issues here a related, so I added them into the same issue.
(1) (fixed with the use of `calcite-list`)
Add an option to value list to not allow selection of the text, only `action-end`.
This is a lists of values in the filter component, clicking on a value name does not call an action. Only
action-end
matters here.This is a list of detailed information inside a popover. Nothing should happen when you click on the text, only
action-end
matters here as well.(2) (fixed with the use of `calcite-list`)
Navigating in this value list is a bit weird. Initially only the first row, first text then action-end, can be selected. If you then tab again it leaves the list. You need to use the down arrow to navigate inside the list, but the down arrow only works on the text, not on action-end. Same with `calcite-pick-list`.
(3)
Focus gets lost if there if no other focusable item after the value-list when using tab key after
action-end
is selected. This is a problem for keyboard only users in the popover case above. How can I catch the focus (or know when the focus leaves value-list) and redirect it back to the close icon of the popover? I triedonBlur
but that didn't work.Scenario:
popover opens with close button on focus. Then I tab my way through the list. After the last focusable item in the list is active and I hit tab the focus gets lost.
New list component #2117
Actual Behavior
Expected Behavior
Reproduction Steps or Sample
Relevant Info
Version:
@esri/calcite-components@<version>
The text was updated successfully, but these errors were encountered: