Closed zhaoyao91 closed 3 years ago
When tippy content is inside a shadow dom, the interactive option is not working.
interactive
The reason is
Events that happen in shadow DOM have the host element as the target, when caught outside of the component.
the popper is inside the host, so popper.contains(target) will always return false. see https://javascript.info/shadow-dom-events
popper.contains(target)
by using event.composedPath instead of the event.target, it will get the actual target and fix this bug.
event.composedPath
event.target
see https://stackoverflow.com/questions/39245488/event-path-is-undefined-running-in-firefox/39245638#39245638
Thank you!
When tippy content is inside a shadow dom, the
interactive
option is not working.The reason is
the popper is inside the host, so
popper.contains(target)
will always return false. see https://javascript.info/shadow-dom-eventsby using
event.composedPath
instead of theevent.target
, it will get the actual target and fix this bug.see https://stackoverflow.com/questions/39245488/event-path-is-undefined-running-in-firefox/39245638#39245638