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]: React useTrapFocus not working for SfDrawer #3225

Open
2 of 3 tasks
rafabernad opened this issue Sep 10, 2024 · 0 comments
Open
2 of 3 tasks

[Bug]: React useTrapFocus not working for SfDrawer #3225

rafabernad opened this issue Sep 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rafabernad
Copy link

Describe the Bug

useTrapFocus show keep the focus inside all focusable elements in Sfdrawer, but seems to be working only working for the first focusable element.

This wrong behavior can be seen in the storefront-ui demos: Drawer transition and trap focus preview, where the focus is kept in the close icon.

As a side effect, is not possible to have an input inside a drawer, as it never gets focused.

Expected behavior

Using tab, user should be able to move through all the focusable elements.

Steps to reproduce

See: Drawer transition and trap focus

SFUI version

@storefront-ui/react@2.7.0

Framework

Next.js

Node version

v20.3.0

Browser

Chrome

OS

MacOS

Relevant log output

No response

Able to fix / change the documentation?

  • Yes
  • No

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rafabernad rafabernad added the bug Something isn't working label Sep 10, 2024
@rafabernad rafabernad changed the title [Bug]: React useTrapFocus not working of SfDrawer [Bug]: React useTrapFocus not working for SfDrawer Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant