Closed strarsis closed 1 year ago
In browsers where both the <dialog>
element and the overscroll-behavior
property are supported, does this issue occur without the usage of this package? If so, it would seem you've discovered a browser issue, which may not be an issue with this package.
@jonathandewitt-dev: Yes, the same issue can be observed with native <dialog>
support and functioning overscroll-behavior
(Google Chrome).
Can you reproduce this with this minimal test case?: https://codepen.io/strarsis/pen/RwBBWQz This would mean this is indeed a browser bug.
@jonathandewitt-dev: Edit 2: After some further testing I notice that overscroll-behavior: contain
only prevents scrolling in parent when the child element has something to scroll. When the child element has nothing to scroll, the parent element will be scrolled instead.
Non-scrollable child (bug occurs): https://codepen.io/strarsis/pen/RwBBWQz Scrollable child (bug does not occur): https://codepen.io/strarsis/pen/qByLKLe
When the dialog is open, notably in
modal
mode, it is possible to still scroll the page behind of thedialog
. The new and now fairly well supportedoverscroll-behavior
CSS property could be applied to thedialog
element in order to prevent scrolling of the page when the inside of the dialog is scrolled (overscroll-behavior: contain
).However, it doesn't seem to work with the
dialog
element, scrolling inside thedialog
will still scroll the page.