Skip to content

Commit 67148f0

Browse files
committed
special-case for third-party draggables
1 parent 824220f commit 67148f0

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

standard/packages/interaction/src/interactions-external/ThirdPartyDraggable.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ export class ThirdPartyDraggable {
4343
dragging.mirrorSelector = settings.mirrorSelector
4444
}
4545

46-
new ExternalElementDragging(dragging, settings.eventData) // eslint-disable-line no-new
46+
let externalDragging = new ExternalElementDragging(dragging, settings.eventData)
47+
48+
// The hit-detection system requires that the dnd-mirror-element be pointer-events:none,
49+
// but this can't be guaranteed for third-party draggables, so disable
50+
externalDragging.hitDragging.disablePointCheck = true
4751
}
4852

4953
destroy() {

standard/packages/interaction/src/interactions/HitDragging.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class HitDragging {
3232
// options that can be set by caller
3333
useSubjectCenter: boolean = false
3434
requireInitial: boolean = true // if doesn't start out on a hit, won't emit any events
35+
disablePointCheck: boolean = false
3536

3637
// internal state
3738
offsetTrackers: { [componentUid: string]: OffsetTracker }
@@ -189,11 +190,14 @@ export class HitDragging {
189190
// Ensure the component we are querying for the hit is accessibly my the pointer
190191
// Prevents obscured calendars (ex: under a modal dialog) from accepting hit
191192
// https://github.com/fullcalendar/fullcalendar/issues/5026
192-
offsetTracker.el.contains(
193-
document.elementFromPoint(
194-
// add-back origins to get coordinate relative to top-left of window viewport
195-
positionLeft + originLeft - window.scrollX,
196-
positionTop + originTop - window.scrollY,
193+
(
194+
this.disablePointCheck ||
195+
offsetTracker.el.contains(
196+
document.elementFromPoint(
197+
// add-back origins to get coordinate relative to top-left of window viewport
198+
positionLeft + originLeft - window.scrollX,
199+
positionTop + originTop - window.scrollY,
200+
)
197201
)
198202
) &&
199203
(!bestHit || hit.layer > bestHit.layer)

0 commit comments

Comments
 (0)