-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Firefox tabIndex problem when using open prop #5084
Closed
avazhenin opened this issue
Sep 9, 2024
· 5 comments
· Fixed by qburst/react-datepicker-3#35 or #5179
Closed
Firefox tabIndex problem when using open prop #5084
avazhenin opened this issue
Sep 9, 2024
· 5 comments
· Fixed by qburst/react-datepicker-3#35 or #5179
Comments
Hi, I couldn't access the video you shared. Could you make it public? so that we can understand the issue. |
Any updates? |
I am also facing same issue i got workaround but it is not a rigid solution const isFirefox = typeof InstallTrigger !== 'undefined'; if (isFirefox) { // Apply Firefox-specific logic if (key === 'Tab') { e.preventDefault(); // prevent the current event if (ref?.current) { ref.current.setOpen(false); // Find the next focusable element manually setTimeout(() => { const allFocusableElements = document.querySelectorAll('input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'); console.log('Array.from(allFocusableElements) ',Array.from(allFocusableElements)); // List all focusable elements const currentIndex = Array.from(allFocusableElements).indexOf(e.target); console.log('currentIndex ',currentIndex); // List all focusable elements if (shiftKey) { if (currentIndex > 0) { allFocusableElements[currentIndex - 1].focus(); } } else { if (currentIndex !== -1 && allFocusableElements[currentIndex + 1]) { allFocusableElements[currentIndex + 1].focus(); // Move focus to the next input } } }, 0); // Delay to ensure the current element is blurred before focus moves } } } |
Hi @avazhenin, Sorry for the late reply. I started working on the fix. I'll raise a PR by this Monday. Once the fix got merged you'll get an update. Thank you |
balajis-qb
pushed a commit
to qburst/react-datepicker-3
that referenced
this issue
Oct 21, 2024
…n to the next event loop - This issue is caused due to the defer blur made in the commit 3682222 is getting executed after the focus operation for the ESC key press Close Hacker0x01#5084
This was referenced Oct 21, 2024
martijnrusschen
added a commit
that referenced
this issue
Oct 21, 2024
🐛 Fix #5084: Fixfox Tab switch issue
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Using react date picker with open prop, causes strange tabIndex behavior in FireFox browser. Video and Codesandbox attached.
To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/p/sandbox/react-datepicker-example-forked-24w5sd
Expected behavior
Tab button behavior work as expected, same as in GoogleChrome ( watch in video )
Video
https://drive.google.com/file/d/1yIQKGIr6MHaDInJKruGQErJUkAm833EV/view?usp=drive_link
Desktop (please complete the following information):
Additional context
"react": "16.8.4",
"react-datepicker": "^7.3.0",
"@types/react-datepicker": "^7.0.0",
Same behavior with previous versions of react-datepicker
The text was updated successfully, but these errors were encountered: