Closed PottyZA closed 5 months ago
v2.5.10 was released with the fix.
However, I need to point out that the code responsible for the same behaviour was already in place, including a use case in a storybook representing "lock in a shadow dom" example.
I failed to reproduce the problem and it's unclear what exactly is happening here. parameter 1 is not of type 'Element'
, but it's not ShadowRoot
as well.
Only you can confirm the fix and clarify the original problem.
Similar to #89, if the
<RemoveScroll>
component is used inside a shadow root, the code insideelementCanBeScrolled
can sometimes fail with the error message:For example, when using
@radix-ui/react-dialog
(version1.0.6-rc.5
), which usesreact-remove-scroll@2.5.7
(the error also occurs if you force2.5.9
), if you attempt to scroll inside a shadow root when scrolling should be disabled (ie. if the content is not overflowing), then the error above is raised.This could possibly be due to the shadow root not being an actual element. After some testing, it appears that this can be fixed by adding the following code to
elementCanBeScrolled()
: