Shadow DOM重定向和Radium:悬停

时间:2017-08-18 01:25:08

标签: reactjs javascript-events shadow-dom radium

我在Shadow DOM中使用React时遇到了这个问题。我一直在使用与此类似的设置来处理事件重定向。

https://github.com/LukasBombach/react-shadow-dom-retarget-events/blob/master/index.js

镭':悬停'包装我的React组件

时不起作用

1 个答案:

答案 0 :(得分:0)

问题是Radium使用onMouseEnter和onMouseLeave。由于冒泡使用这些事件的方式,我们不会看到这些事件在与Shadow DOM内的元素交互时触发。 Jeff Dolle和我解决的解决方案是当onMouseOver事件在onMouseOut事件触发时使用目标元素和onMouseLeave事件触发时调度onMouseEnter事件。