-
Notifications
You must be signed in to change notification settings - Fork 208
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
First input in popup autofocuses #250
Comments
Hello, It seems to be the intended behaviour, for accessibility purpose. Extract from https://react-popup.elazizi.com/react-popup-accessibility
However, this feature is also causing some problems for me because despite restoring the first focused element on close, it loses the original selection... |
Yes, please add an optional prop to disable this 😞 |
Use a dummy input field like radio button without content as first input in form and make it "display:none" in css. Then the focus goes to that element instead of the first visible input. |
The problem is that the current focused element before opening gets unfocused on popup open. In our projects this is a big issue as we have to refocus the previous focused element after opening popup. |
I have the same issue as @ronangaillard. I use a popup as the container for suggestions list on a search input. On first click on the search input, the following occurs :
In terms of UX it means that the user has to click twice to effectively focus the text input at first ! |
Any update on this issue ? |
I fixed this problem and open PR, hope it will be merged soon |
Greetings, traveller. Currently I'm facing a bug, which can shortly be described like: "First input in any popup autofocuses and neither "tabIndex: -1", nor "autofocus={'false'}" can help fixing it.
Version
2.0.4
Test Case
https://codesandbox.io/s/restless-shape-n5o0k?file=/src/index.tsx
Expected Behavior
I expect first input not to focus, i've already tried changing tabIndex and set autofocus false.
Actual Behavior
It, unexpectedly (wow!) autofocuses.
What can I do to fix it?
The text was updated successfully, but these errors were encountered: