Merge pull request #11082 from ahocevar/fix-drag-away
Fix outside window dragging
This commit is contained in:
+10
-7
@@ -1030,14 +1030,17 @@ class PluggableMap extends BaseObject {
|
|||||||
originalEvent.clientY
|
originalEvent.clientY
|
||||||
);
|
);
|
||||||
if (
|
if (
|
||||||
this.overlayContainerStopEvent_.contains(target) ||
|
// Do not abort when the pointer is outside the shadow root
|
||||||
!(document.body.contains(target) || this.viewport_.contains(target))
|
originalEvent.target !== document.documentElement &&
|
||||||
|
// Abort when target is on overlayContainerStopEvent
|
||||||
|
(this.overlayContainerStopEvent_.contains(target) ||
|
||||||
|
// Abort if the event target is a child of the container that doesn't allow
|
||||||
|
// event propagation or is no longer in the page. It's possible for the target to no longer
|
||||||
|
// be in the page if it has been removed in an event listener, this might happen in a Control
|
||||||
|
// that recreates it's content based on user interaction either manually or via a render
|
||||||
|
// in something like https://reactjs.org/
|
||||||
|
!(document.body.contains(target) || rootNode.contains(target)))
|
||||||
) {
|
) {
|
||||||
// Abort if the event target is a child of the container that doesn't allow
|
|
||||||
// event propagation or is no longer in the page. It's possible for the target to no longer
|
|
||||||
// be in the page if it has been removed in an event listener, this might happen in a Control
|
|
||||||
// that recreates it's content based on user interaction either manually or via a render
|
|
||||||
// in something like https://reactjs.org/
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user