Skip to content

Commit

Permalink
Adds hold and drag just for touch events
Browse files Browse the repository at this point in the history
  • Loading branch information
latin-panda committed Jan 27, 2025
1 parent 7ed379e commit fda6382
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web-forms/src/components/controls/RankControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface RankDraggableOption {
}
const props = defineProps<RankControlProps>();
const HOLD_DELAY = 60; // Delay in ms to hold an item before dragging, avoids accidental reordering on swipe.
const HOLD_DELAY = 200; // Delay in ms to hold an item before dragging, avoids accidental reordering on swipe.
const options = ref<RankDraggableOption[]>([]);
const touched = ref(false);
const submitPressed = inject<boolean>('submitPressed');
Expand Down Expand Up @@ -102,6 +102,7 @@ const swapItems = (index: number, newPosition: number) => {
:id="question.nodeId"
v-model="options"
:delay="HOLD_DELAY"
:delay-on-touch-only="true"
:disabled="question.currentState.readonly"
ghost-class="fade-moving"
class="rank-control"
Expand Down

0 comments on commit fda6382

Please sign in to comment.