fix
This commit is contained in:
@@ -8,6 +8,14 @@ const DRAG_HYSTERESIS_PX = 4;
|
||||
const DRAG_HYSTERESIS_SQUARED = DRAG_HYSTERESIS_PX * DRAG_HYSTERESIS_PX;
|
||||
const EDGE_COLLISION_THRESHOLD = 0.5;
|
||||
|
||||
const getEventTargetElement = (event) => {
|
||||
if (typeof Element === 'undefined' || !event) {
|
||||
return null;
|
||||
}
|
||||
const candidate = event.target || (event.nativeEvent ? event.nativeEvent.target : null);
|
||||
return candidate instanceof Element ? candidate : null;
|
||||
};
|
||||
|
||||
const useDocumentDrag = (options = {}) => {
|
||||
const {
|
||||
engine,
|
||||
@@ -139,6 +147,10 @@ const useDocumentDrag = (options = {}) => {
|
||||
|
||||
const handlePointerDown = useCallback(
|
||||
(event, docIdInput, options = {}) => {
|
||||
const targetElement = getEventTargetElement(event);
|
||||
if (targetElement && typeof targetElement.closest === 'function' && targetElement.closest('[data-desk-tag-chip="true"]')) {
|
||||
return;
|
||||
}
|
||||
preventAll(event);
|
||||
|
||||
const docId = docIdInput != null ? docIdInput : null;
|
||||
|
||||
Reference in New Issue
Block a user