-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
[FocusTrap] is planned? #1374
Comments
All of our components manage focus automatically, and also provide props to customise focus management in some cases. I'm curious why you'd like to use a focus trap utility directly. Can you share more about your use case? |
I tried to make a demo with popover: https://codesandbox.io/p/sandbox/58wl54?file=%2Fsrc%2FApp.tsx The popover has two inputs. The focus after the second one goes out, closing the popover. This is acceptable behavior in my case, but ideally I would like to have a looping focus inside the popover content for as long as the popover is open. I haven't found a way to set up this yet. |
@dartess this sounds like a "modal" popover, which would trap and loop focus. However modality would also block outside pointer events and lock page scroll - is that acceptable, or should there be config options for that behavior in your case? |
@atomiks This is actually a kind of select, but with a complex list component that includes sorting items as well as a filter input. Strictly speaking, in my case, the behavior of automatically closing the popover when focus goes away solves the original bug when So my request is worthless — if Perhaps other users can provide more valuable examples of direct Thanks for your time. |
Feature request
Summary
FocusTrap
Examples in other libraries
@mui/base
: https://mui.com/base-ui/react-focus-trap/focus-trap
: https://www.npmjs.com/package/focus-trapMotivation
I'm currently using this component from deprecated
@mui/base
. Please tell, is it planned to move this component from@mui/base
in the first version of@base-ui-components/react
, or it definitely won't be there and I should migrate to a third-party package?The text was updated successfully, but these errors were encountered: