microsoft / tabster

Web Application Keyboard Navigation Tools
https://tabster.io
MIT License
118 stars 36 forks source link

Groupper: reset focus trap when focus leaves the group #310

Open smhigley opened 11 months ago

smhigley commented 11 months ago

This bug can be found using the following steps (reproducible in the storybook for groupper):

  1. tab to the focus group container
  2. hit enter to reach the first focusable button
  3. click outside the focus group to move focus outside of it
  4. tab back to the focus group, and observe that tab reaches the inner buttons & is then trapped within the group without needing to hit enter again

The desired behavior would be that if focus leaves a focus group without using Escape (e.g. through clicking elsewhere, using a screen reader's virtual cursor, or mixing modes in any of several other ATs), the focus group state is reset and the user would need to hit enter again to reach inner items if the tabability is set to limited or limited-tab-focus.