Skip to content

Commit

Permalink
fix: mouseenter wasn't being emitted when mouseover was emitted at th…
Browse files Browse the repository at this point in the history
…e same time (#360)

* feat: WIP Enhanced alignments

* improvements

* tweak

* remove display attribute, remove 'both' direction, fix tests, fix docs, fix examples, fix components

* feat: Updated examples

* tests

* fixed tests

* update table component and example

* clean up

* clean up

* improvements

* improvements

* fixes

* fix tests

* tweak

* tweaks

* unsized alignment test

* document code

* tweak

* rename attributes

* fixes and cleanup

* fixes and improvements

* typo

* fix: mouseenter wasn't being emitted when mouseover was emitted at the same time
  • Loading branch information
marc2332 authored Oct 26, 2023
1 parent 2e62db1 commit ac1d1e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/core/src/events_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ impl EventsProcessor {
// All these events will mark the node as being hovered
// "mouseover" "mouseenter" "pointerover" "pointerenter"

// We clone this here so events emitted in the same batch that mark an element as hovered will not affect the other events
let hovered_elements = self.hovered_elements.clone();

// Emit valid events
for event in &events_to_emit {
let id = &event.node_id;
Expand All @@ -88,7 +91,7 @@ impl EventsProcessor {
| name @ "mouseenter"
| name @ "pointerover"
| name @ "pointerenter" => {
let is_hovered = self.hovered_elements.contains(id);
let is_hovered = hovered_elements.contains(id);

if !is_hovered {
self.hovered_elements.insert(*id);
Expand Down

0 comments on commit ac1d1e3

Please sign in to comment.