react-laag icon indicating copy to clipboard operation
react-laag copied to clipboard

[BUG] shadow DOM not working via environment parameter

Open elseee opened this issue 2 years ago • 0 comments

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:

  1. Add useLayer hook into an app which uses shadow DOM
  2. Provide container in shadow DOM
  3. 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 Screenshot 2022-03-10 at 13 53 07

elseee avatar Mar 10 '22 12:03 elseee