简体   繁体   中英

mouseEnter and mouseLeave not working on ember?

I have a pretty simple component. Basically when I hover over it I want it to set the 'showTooltip' property based on the component to true, and when I hover off, I set it back to false. For whatever reason this doesn't seem to be working, and for the foggiest cannot figure out why (seeing as I have a click event on there too and that works fine as well). I'm runnimg Ember 2.8.

mouseEnter() {
 this.set('showTooltip', true);
 return false;
},

mouseLeave() {
 this.set('showTooltip', false);
 return false;
}

Here is a twiddle for you. It is working on 2.8.

You should care about some situations:

  • event handlers are not written in "actions" hash.
  • component must not be a "tagless" component. (Don't override tagName with undefined/null)

If you provide a twiddle, we may look further.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM