Skip to content

Commit

Permalink
hotfix: do not propagate object.defaultPointerEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Oct 30, 2024
1 parent 5e52008 commit f85f45e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/pointer-events/src/intersections/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,24 @@ export function intersectPointerEventTargets(
parentPointerEventsOrder?: number,
): void {
const hasListener = parentHasListener || hasObjectListeners(object)
const pointerEvents = object.pointerEvents ?? parentPointerEvents ?? object.defaultPointerEvents ?? 'listener'
const pointerEvents = object.pointerEvents ?? parentPointerEvents
const pointerEventsOrDefault = pointerEvents ?? object.defaultPointerEvents ?? 'listener'
const pointerEventsType = object.pointerEventsType ?? parentPointerEventsType ?? 'all'
const pointerEventsOrder = object.pointerEventsOrder ?? parentPointerEventsOrder ?? 0

const isAllowed = isPointerEventsAllowed(hasListener, pointerEvents, pointerEventsType)
const isAllowed = isPointerEventsAllowed(hasListener, pointerEventsOrDefault, pointerEventsType)
const length = pointers.length
if (isAllowed === true) {
for (let i = 0; i < length; i++) {
filterAndInteresct(pointers[i], object, pointerEvents, pointerEventsType, pointerEventsOrder)
filterAndInteresct(pointers[i], object, pointerEventsOrDefault, pointerEventsType, pointerEventsOrder)
}
} else if (typeof isAllowed === 'function') {
for (let i = 0; i < length; i++) {
const pointer = pointers[i]
if (!isAllowed(pointer)) {
continue
}
filterAndInteresct(pointer, object, pointerEvents, pointerEventsType, pointerEventsOrder)
filterAndInteresct(pointer, object, pointerEventsOrDefault, pointerEventsType, pointerEventsOrder)
}
}

Expand Down

0 comments on commit f85f45e

Please sign in to comment.