Skip to content

Commit

Permalink
fix(core): Fix shouldPreventDefaultBeforeDispatching bug (#56188)
Browse files Browse the repository at this point in the history
When I copied this over in caedd10
the parentheses moved around the A tag check and the CLICK type check,
instead of around the CLICK and CLICKMOD check.

PR Close #56188
  • Loading branch information
tbondwilkinson authored and thePunderWoman committed May 30, 2024
1 parent 616cdef commit 2a440e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/primitives/event-dispatch/src/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ function shouldPreventDefaultBeforeDispatching(
// a child of an anchor that has a jsaction attached. For that reason, we
// need to check the actionElement rather than the targetElement.
return (
(actionElement.tagName === 'A' && eventInfoWrapper.getEventType() === EventType.CLICK) ||
eventInfoWrapper.getEventType() === EventType.CLICKMOD
actionElement.tagName === 'A' &&
(eventInfoWrapper.getEventType() === EventType.CLICK ||
eventInfoWrapper.getEventType() === EventType.CLICKMOD)
);
}

Expand Down

0 comments on commit 2a440e1

Please sign in to comment.