Is it possible for a "ClickEvent" to supersede a "MouseLeaveEvent"?

  • I currently have a UI element with “MouseEnterEvent”, “MouseLeaveEvent”, and “ClickEvent” callbacks
  • I would like the MouseLeaveEvent to not be called when it is due to a “ClickEvent”
  • How can I have the MouseLeaveEvent not be triggered when the element disappears due to a ClickEvent be triggered when the element is hovered over but not clicked (which causes the element to disappear and then triggers the MouseLeaveEvent)

Hi,
what do you mean by “… when the element disappears due to a ClickEvent…”? Do you hide your element upon click?

Yes, so my data element is a row in a table.

  • when you hover onto the row an action happens

  • when you hover off a row an action happens

  • when you click on a a row, the table disappears and you are taken to an item details view

  • the user clicking on the table item is counting as a “hover off” because the table disappears

Why don’t you check the visibility state in the MouseLeaveEvent to decide whether you should ignore it?

1 Like

Another option could be to unregister from MouseLeaveEvent on click but you will need to register it back at some point.

I will make a state boolean about whether it was clicked or not and check that