Skip to content

Commit

Permalink
fix: reduce touch start delay
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdurow committed Jan 20, 2023
1 parent e685553 commit 42e6430
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions code-component/PowerDragDrop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
// without registering a callback method in teh global scope
const REGISTER_ZONES_DEBOUNCE = 500;
const REGISTER_ZONE_TICK = 1000;
const DRAG_START_DELAY = 100;

interface RegisteredZone {
index: number;
Expand All @@ -47,8 +48,6 @@ const defaultSortableOptions: Sortable.Options = {
ghostClass: CSS_STYLE_CLASSES.Ghost,
chosenClass: CSS_STYLE_CLASSES.Chosen,
dataIdAttr: RECORD_ID_ATTRIBUTE,
delay: 100,
delayOnTouchOnly: true,
};

export class PowerDragDrop implements ComponentFramework.StandardControl<IInputs, IOutputs> {
Expand Down Expand Up @@ -371,8 +370,8 @@ export class PowerDragDrop implements ComponentFramework.StandardControl<IInputs
scroll: this.context.parameters.Scroll?.raw === true,
sort: this.context.parameters.PreserveSort?.raw !== true,
dragClass: dragClass,
delay: this.context.parameters.DelaySelect?.raw !== '0' ? 200 : 0,
delayOnTouchOnly: this.context.parameters.DelaySelect?.raw === '2',
delay: this.context.parameters.DelaySelect?.raw !== '0' ? DRAG_START_DELAY : undefined,
delayOnTouchOnly: this.context.parameters.DelaySelect?.raw === '2' ? true : false,
} as Sortable.Options;
}

Expand Down

0 comments on commit 42e6430

Please sign in to comment.