-
-
Notifications
You must be signed in to change notification settings - Fork 47.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Affix 组件event listener 未被正确移除 #4755
Comments
我也碰到了这个问题,提供一个测试页面:http://jiangxy.github.io/ant-debug 不过我传给Affix的target不是通过ref方式获取的,而是直接document.getElement 如果将antd版本换成1.11.0就正常了 |
你的这个原因也是因为didMount里面监听被延迟导致该监听晚于willReceive里面的监听使得重复监听了,移除的时候只移除了最后一次的,前面的被保留了,后来每次切换监听器的数量在不断增加,尝试我说的那个方法修改affix的源码应该能解决问题 |
+ close ant-design#4755 + close ant-design#4760 + clearScrollEventListeners before setTargetEventListeners + add tests for throttle + append affix test case
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
Environment(required)
What did you do? Please provide steps to re-produce your problem.
What do you expected?
期望事件被正确监听一次,Affix unmount后事件正确被移除
尝试在setTargetEventListeners监听事件前调用clearScrollEventListeners,结果符合预期
The text was updated successfully, but these errors were encountered: