Skip to content

Commit

Permalink
fix pointer events none (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmoulton authored Jan 17, 2025
1 parent cd45320 commit 3e25a60
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ impl EventCx<'_> {
false
};

let is_pointer_none = event.is_pointer()
&& view_state.borrow().computed_style.get(PointerEventsProp)
== Some(PointerEvents::None);

if !disable_default
&& !is_pointer_none
&& view
.borrow_mut()
.event_before_children(self, &event)
Expand Down Expand Up @@ -172,6 +177,7 @@ impl EventCx<'_> {
}

if !disable_default
&& !is_pointer_none
&& view
.borrow_mut()
.event_after_children(self, &event)
Expand All @@ -180,10 +186,7 @@ impl EventCx<'_> {
return (EventPropagation::Stop, PointerEventConsumed::Yes);
}

if event.is_pointer()
&& view_state.borrow().computed_style.get(PointerEventsProp)
== Some(PointerEvents::None)
{
if is_pointer_none {
// if pointer-events: none, we don't handle the pointer event
return (EventPropagation::Continue, view_pointer_event_consumed);
}
Expand Down

0 comments on commit 3e25a60

Please sign in to comment.