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

Focus on the input element is lost when trying to scroll modal content by dragging scrollbar #1013

Open
pavelkeyzik opened this issue Mar 31, 2023 · 0 comments

Comments

@pavelkeyzik
Copy link

Summary:

Hi! I've noticed the issue with focus behavior when scrolling using the scrollbar. By default, the focus is not lost when I scroll with the scrollbar but when I use the same input in the modal, it loses focus. See attachment below.

CleanShot.2023-03-31.at.10.21.12.mp4

Steps to reproduce:

  1. Add input inside the modal and add some content, so the modal is scrollable
  2. Focus on the input
  3. Scroll by dragging scrollbar

Expected behavior:

Focus on input is not lost

Link to example of issue:

Link to the example https://codepen.io/pavelkeyzik/pen/MWqdZdJ

Additional notes:

I feel like it's because of the tab-index="-1" attribute of .ReactModal__Content element, after removing this attribute it does work properly, but I'm not sure what's the replacement will be 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant