MouseOver 和 MouseOut 事件不会被小部件触发
我有两个小部件正在监听 MouseOutEvent。问题是,有时即使您将鼠标移出两个小部件,也不会在两个小部件上调用此事件。 不会引发任何错误,并且这非常难以调试。 我的理解是这个事件是由浏览器触发的,所以我不明白为什么这种情况没有发生。我正在将此事件注册到小部件本身。
任何建议都会有很大的帮助。
谢谢
I have two widgets listening for a MouseOutEvent. Problem is that sometimes this events does not get called on both of the widgeth even if you mouse out of them.
No error is thrown and this is extremely hard to debug.
My understanding is that this event is fired by a browser, so I don't understand why this is not happening. I am registering this event to the widget itself.
Any suggestions will be a great help.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您可能已经使用 addHandler 来注册到 MouseOverHandler。 Widget 有两种添加事件处理程序的方法,addDomHandler 和 addHandler。第一个用于 DomEvents,例如 MouseOutEvents。它接收小部件上的事件,这意味着您的侦听器将收到通知(这仅对于 DomEvents 是必要的)。如果您不使用 addDomHandler 注册处理程序,这些事件可能不会被触发。
Sounds like you might have used addHandler to register to your MouseOverHandler. Widget has two methods for adding event handlers, addDomHandler and addHandler. The first is meant to be used for DomEvents, e.g. MouseOutEvents. It sinks the event on the widget, which means that your listener will get notified (this is only necessary for DomEvents). Those events might not get fired if you do not use addDomHandler to register your handler.