Skip to content

Commit e81da08

Browse files
chore: pushes new dist
1 parent 876a7bc commit e81da08

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

dist/index.cjs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@ var documentController3;
11661166
var windowController;
11671167
var scrollTimeout;
11681168
var touchDevice = false;
1169+
var useNativeDrag = false;
11691170
function resetState() {
11701171
const baseDragState2 = {
11711172
activeDescendant: void 0,
@@ -1204,11 +1205,16 @@ function setDragState(dragStateProps2) {
12041205
state.emit("dragStarted", state);
12051206
return state;
12061207
}
1207-
function handleRootPointerdown(_e) {
1208+
function handleRootPointerdown(e) {
12081209
if (state.activeState) setActive(state.activeState.parent, void 0, state);
12091210
if (state.selectedState)
12101211
deselect(state.selectedState.nodes, state.selectedState.parent, state);
12111212
state.selectedState = state.activeState = void 0;
1213+
if (e.pointerType === "mouse") {
1214+
useNativeDrag = true;
1215+
} else if (e.pointerType === "touch" || e.pointerType === "pen") {
1216+
useNativeDrag = false;
1217+
}
12121218
}
12131219
function handleRootPointerup(e) {
12141220
pd(e);
@@ -1240,6 +1246,9 @@ function handleRootDragover(e) {
12401246
function handleRootPointermove(e) {
12411247
if (!state.pointerDown || !state.pointerDown.validated) return;
12421248
const config = state.pointerDown.parent.data.config;
1249+
if (useNativeDrag || e.pointerType === "mouse") {
1250+
return;
1251+
}
12431252
if (!isSynthDragState(state) && (touchDevice || !touchDevice && !config.nativeDrag)) {
12441253
pd(e);
12451254
if (config.longPress && !state.longPress) {
@@ -1954,6 +1963,11 @@ function handleNodePointerdown(data, state2) {
19541963
node: data.targetData.node,
19551964
validated: false
19561965
};
1966+
if (data.e.pointerType === "mouse") {
1967+
useNativeDrag = true;
1968+
} else if (data.e.pointerType === "touch" || data.e.pointerType === "pen") {
1969+
useNativeDrag = false;
1970+
}
19571971
if (!validateDragHandle({
19581972
x: data.e.clientX,
19591973
y: data.e.clientY,

dist/index.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.mjs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ var documentController3;
10751075
var windowController;
10761076
var scrollTimeout;
10771077
var touchDevice = false;
1078+
var useNativeDrag = false;
10781079
function resetState() {
10791080
const baseDragState2 = {
10801081
activeDescendant: void 0,
@@ -1113,11 +1114,16 @@ function setDragState(dragStateProps2) {
11131114
state.emit("dragStarted", state);
11141115
return state;
11151116
}
1116-
function handleRootPointerdown(_e) {
1117+
function handleRootPointerdown(e) {
11171118
if (state.activeState) setActive(state.activeState.parent, void 0, state);
11181119
if (state.selectedState)
11191120
deselect(state.selectedState.nodes, state.selectedState.parent, state);
11201121
state.selectedState = state.activeState = void 0;
1122+
if (e.pointerType === "mouse") {
1123+
useNativeDrag = true;
1124+
} else if (e.pointerType === "touch" || e.pointerType === "pen") {
1125+
useNativeDrag = false;
1126+
}
11211127
}
11221128
function handleRootPointerup(e) {
11231129
pd(e);
@@ -1149,6 +1155,9 @@ function handleRootDragover(e) {
11491155
function handleRootPointermove(e) {
11501156
if (!state.pointerDown || !state.pointerDown.validated) return;
11511157
const config = state.pointerDown.parent.data.config;
1158+
if (useNativeDrag || e.pointerType === "mouse") {
1159+
return;
1160+
}
11521161
if (!isSynthDragState(state) && (touchDevice || !touchDevice && !config.nativeDrag)) {
11531162
pd(e);
11541163
if (config.longPress && !state.longPress) {
@@ -1863,6 +1872,11 @@ function handleNodePointerdown(data, state2) {
18631872
node: data.targetData.node,
18641873
validated: false
18651874
};
1875+
if (data.e.pointerType === "mouse") {
1876+
useNativeDrag = true;
1877+
} else if (data.e.pointerType === "touch" || data.e.pointerType === "pen") {
1878+
useNativeDrag = false;
1879+
}
18661880
if (!validateDragHandle({
18671881
x: data.e.clientX,
18681882
y: data.e.clientY,

dist/index.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)