react-laag
react-laag copied to clipboard
[BUG] shadow DOM not working via environment parameter
Describe the bug
I'm trying to use the useLayer
hook in the shadow DOM. I succeeded in getting the correct styling by using the container
parameter. Some of the behaviour, like clicking outside the layer, still doesn't work though. This is happening because event listeners are added to the window and not in the shadow DOM itself. The environment
seems to be a parameter that could fix this issue, however it has to be of type Window and it throws an error if the root element of the shadow DOM is used. (see screenshot).
To Reproduce Steps to reproduce the behavior:
- Add
useLayer
hook into an app which uses shadow DOM - Provide container in shadow DOM
- Event handlers aren't added to the shadow DOM, but to the window
Expected behavior Provide a way to add event listeners within the shadow DOM.
Screenshots