Closed kmthorsnes closed 8 months ago
@kmthorsnes Do you see this behavior in all browsers? Which version of react and react-modal are you using?
@diasbruno Thank you for replying!
Do you see this behavior in all browsers?
- Yes, I have tested with brave, safari and firefox.
Which version of react and react-modal are you using?
- React:
17.0.2
- react-modal:
3.11.2
preventScroll
was released on version 3.12.1
. But we also don't have any "reported bugs" since its release.
Ah sorry.
If you have this configuration:
<modal>
<your_component /> <----
</modal>
your_component
will always be rendered, it's just not attached to the dom tree. The dom elements it produces may live longer and this explains why it persists the scroll position.
You'll probably need to, on exit, use container.scrollTo(0,0)
(or something like this).
preventScroll
actually focus the element that triggered the modal to open.
@diasbruno Thank you! I'll have a closer look at this!
I'll close this for now. Please feel free to reopen if that doesn't help. Thanks!
Summary:
Steps to reproduce:
Expected behavior:
Additional notes:
preventScroll
atribute, but that does not look to be what im looking for?