Skip to content
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 Report][3.0.1] v-navigation-drawer does not have focus trap #16140

Open
rafaeldsousa opened this issue Nov 22, 2022 · 5 comments
Open

[Bug Report][3.0.1] v-navigation-drawer does not have focus trap #16140

rafaeldsousa opened this issue Nov 22, 2022 · 5 comments
Assignees
Labels
C: VNavigationDrawer VNavigationDrawer T: bug Functionality that does not work as intended/expected

Comments

@rafaeldsousa
Copy link

rafaeldsousa commented Nov 22, 2022

Environment

Vuetify Version: 3.0.1
Vue Version: 3.2.45
Browsers: Chrome 107.0.0.0
OS: Mac OS 10.15.7

Steps to reproduce

Just open the drawer and hit tab, the focused element is not within the drawer. Drawer is not being focused.
I can see the same behaviour happening for the v-menu, the overlay is created but not focus trap is added.

The docs for v-menu state that (no reference of this for v-navigation-drawer)
By default, v-menu components are detached and moved to the root of your application. In order to properly support inserting dynamic content into the DOM, you must use the attach prop. This will ensure that focus transfers from the activator to the content when pressing the tab key.

Expected Behavior

Once drawer is open, focus should be trapped within new element. As per Material UI drawers (Open any of the example drawers and hit tab)
https://mui.com/material-ui/react-drawer/

Actual Behavior

Drawer and V-Menu is opened and focus is not set to overlay div.

Reproduction Link

https://codepen.io/rafaeldesousa/pen/abKqLgL

@atilkan
Copy link

atilkan commented Nov 23, 2022

Have the same problem.

@rafaeldsousa
Copy link
Author

rafaeldsousa commented Nov 23, 2022

Seems like the problem also affects the v-overlay component, which is used for temporary drawers and menus. Focus is not changed when element is created.

Both v2-3 have the same behaviour. Open the overlay and hit tab, you'll see that the focus isn't within the recently opened overlay.

https://vuetifyjs.com/en/components/overlays/
https://next.vuetifyjs.com/en/components/overlays/

@rafaeldsousa rafaeldsousa changed the title [Bug Report][3.0.1] V-Navigation-Drawer - Temporary V-Navigation-Drawer does not have focus trap [Bug Report][3.0.1] V-Overlay does not have focus trap [V-Navigation-Drawer - Temporary V-Navigation-Drawer does not have focus trap] Nov 23, 2022
@rafaeldsousa rafaeldsousa changed the title [Bug Report][3.0.1] V-Overlay does not have focus trap [V-Navigation-Drawer - Temporary V-Navigation-Drawer does not have focus trap] [Bug Report][3.0.1] v-overlay does not have focus trap [v-navigation-drawer - Temporary drawer does not have focus trap] Nov 23, 2022
@rafaeldsousa rafaeldsousa changed the title [Bug Report][3.0.1] v-overlay does not have focus trap [v-navigation-drawer - Temporary drawer does not have focus trap] [Bug Report][3.0.1] v-navigation-drawer does not have focus trap Nov 23, 2022
@jalamanderman
Copy link

I'm also experiencing this issue.

@atilkan
Copy link

atilkan commented Nov 23, 2022

Lets wait for this PR to be merged.

@rafaeldsousa
Copy link
Author

@atilkan I'm not entirely sure this relates to the focus being set on overlays or any dynamically created elements.
Looking at the code for v-navigation-drawer doesn't look like the focus is set anywhere.

@johnleider johnleider added T: bug Functionality that does not work as intended/expected help wanted We are looking for community help C: VNavigationDrawer VNavigationDrawer and removed S: triage labels Jan 22, 2024
@KaelWD KaelWD removed the help wanted We are looking for community help label Feb 15, 2024
@KaelWD KaelWD self-assigned this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VNavigationDrawer VNavigationDrawer T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

5 participants