pradel / react-responsive-modal

Simple responsive react modal
https://react-responsive-modal.leopradel.com/
MIT License
606 stars 95 forks source link

Problem with scroll position, when you have links. #367

Closed bazzzooQa closed 4 years ago

bazzzooQa commented 4 years ago

If you have a lot of content for modal so scroll is needed and f.e. you have link (<a href="/any-link" />) somewhere at the bottom, the scroll position will be set to this link (does it make sense?). Can't figure out what the problem is... Any suggestions?

sa77 commented 4 years ago

@bazzzooQa I just ran into this .. did you get to a solution?

pradel commented 4 years ago

This is because of autofocus, the focus will be set in the modal in the first focusable element when you open the modal. If you want to disable this behavior you can set focusTrapped to false.