You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here I am using a Modal we have built and it uses body-scroll-lock-upgrade and react-focus-lock.
If you open the Modal then scroll down the list, try clicking the label text. It will jump you back up. You can click the checkbox directly but then trying another click elsewhere it will scroll back to that focussed item.
Root cause - you have a focusable element "above" focus lock. When you click on the "text" you are selecting this element and as it is "above" focus (or "outside") the focus will be returned to where it belongs.
How to check: you should be able to select text with a mouse. If you cannot, then something is wrong. Focus-lock implicitly allows for focus to reside on body, but nowhere else.
Hi please see this codesandbox example and demo.
Here I am using a Modal we have built and it uses body-scroll-lock-upgrade and react-focus-lock.
If you open the Modal then scroll down the list, try clicking the label text. It will jump you back up. You can click the checkbox directly but then trying another click elsewhere it will scroll back to that focussed item.
I made a demo without checkboxes and the same thing happens if you click in a grey box. Also a demo without the body-scroll-lock.
Hopefully this is an implementation mistake on our behalf that we have missed. Any ideas?
Thanks
The text was updated successfully, but these errors were encountered: