Skip to content

Commit

Permalink
Update default touch activation constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
clauderic committed Feb 5, 2025
1 parent ce31da7 commit bb4abcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/default-activation-constraints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dnd-kit/dom': patch
---

**PointerSensor**: Removed `distance` from the default activation constraints when the `pointerType` is `touch`. Also updated the default `delay` to `250`ms and `tolerance` to `5` pixels for touch.
5 changes: 5 additions & 0 deletions packages/dom/src/core/manager/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export const defaultPreset: {
return undefined;
}

if (pointerType === 'touch') {
return {
delay: {value: 250, tolerance: 5},
};
}
return {
delay: {value: 200, tolerance: 10},
distance: {value: 5},
Expand Down

0 comments on commit bb4abcd

Please sign in to comment.