Skip to content

Commit

Permalink
fix: fixes issue where prevent default was invoked in handleRootPoint…
Browse files Browse the repository at this point in the history
…ermove when in synthetic drag mode
  • Loading branch information
sashamilenkovic committed Jan 9, 2025
1 parent ccd0911 commit b139db6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,9 +1235,9 @@ function handleRootDragover(e) {
}
function handleRootPointermove(e) {
if (!state.pointerDown) return;
pd(e);
const config = state.pointerDown.parent.data.config;
if (!isSynthDragState(state) && (touchDevice || !touchDevice && !config.nativeDrag)) {
pd(e);
if (config.longPress && !state.longPress) {
clearTimeout(state.longPressTimeout);
state.longPress = false;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,9 +1144,9 @@ function handleRootDragover(e) {
}
function handleRootPointermove(e) {
if (!state.pointerDown) return;
pd(e);
const config = state.pointerDown.parent.data.config;
if (!isSynthDragState(state) && (touchDevice || !touchDevice && !config.nativeDrag)) {
pd(e);
if (config.longPress && !state.longPress) {
clearTimeout(state.longPressTimeout);
state.longPress = false;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ function handleRootDragover(e: DragEvent) {
function handleRootPointermove(e: PointerEvent) {
if (!state.pointerDown) return;

pd(e);

const config = state.pointerDown.parent.data.config;

if (
!isSynthDragState(state) &&
(touchDevice || (!touchDevice && !config.nativeDrag))
) {
pd(e);

if (config.longPress && !state.longPress) {
clearTimeout(state.longPressTimeout);

Expand Down
4 changes: 2 additions & 2 deletions tests/.nuxt/nuxt.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Generated by nuxi
/// <reference types="@nuxt/devtools" />
/// <reference types="@nuxt/telemetry" />
/// <reference types="@nuxtjs/tailwindcss" />
/// <reference types="@nuxt/telemetry" />
/// <reference types="@nuxt/devtools" />
/// <reference types="nuxt" />
/// <reference path="types/app-defaults.d.ts" />
/// <reference path="types/plugins.d.ts" />
Expand Down
4 changes: 1 addition & 3 deletions tests/pages/sort/index.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script setup lang="ts">
import { useDragAndDrop } from "../../../src/vue/index";
const [parent, values] = useDragAndDrop(["Apple", "Banana", "Orange"], {
draggingClass: "blue",
});
const [parent, values] = useDragAndDrop(["Apple", "Banana", "Orange"], {});
onMounted(() => {
// Set initial scroll positions for testing
Expand Down

0 comments on commit b139db6

Please sign in to comment.