react-bootstrap/react-overlays

Support useRootClose inside open shadow roots

charlesroelli opened this issue · 1 comments

Describe the bug

useRootClose doesn't work inside a shadow root as it inspects Event.target instead of Event.composedPath()[0], miscalculating the clicked element as the event is re-targeted to the shadow host.

To Reproduce

Revert the change to src/useRootClose.ts in #1004, and run the new tests.

Reproducible Example

See the fix + test added in #1004.

Expected behavior

useRootClose should work correctly in shadow roots.

Screenshots

Environment (please complete the following information)

Additional context

Add any other context about the problem here.

Fixed in #1004