gantt-lib 0.143.0 → 0.143.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -16852,6 +16852,7 @@ function TaskGanttChartInner(props, ref) {
16852
16852
  }
16853
16853
  }, [tasks, onTasksChange, onUngroupTask]);
16854
16854
  const panStateRef = (0, import_react20.useRef)(null);
16855
+ const PAN_SUPPRESS_PX = 3;
16855
16856
  const handlePanStart = (0, import_react20.useCallback)((e) => {
16856
16857
  if (e.button !== 0) return;
16857
16858
  const target = e.target;
@@ -16871,12 +16872,12 @@ function TaskGanttChartInner(props, ref) {
16871
16872
  scrollY: container.scrollTop,
16872
16873
  currentX: e.clientX,
16873
16874
  currentY: e.clientY,
16874
- frameId: null
16875
+ frameId: null,
16876
+ suppressed: false
16875
16877
  };
16876
16878
  if (document.activeElement instanceof HTMLElement) {
16877
16879
  document.activeElement.blur();
16878
16880
  }
16879
- container.setAttribute("data-panning", "true");
16880
16881
  container.style.cursor = "grabbing";
16881
16882
  e.preventDefault();
16882
16883
  }, [activityActivationStore]);
@@ -16903,6 +16904,10 @@ function TaskGanttChartInner(props, ref) {
16903
16904
  if (!pan?.active) return;
16904
16905
  pan.currentX = e.clientX;
16905
16906
  pan.currentY = e.clientY;
16907
+ if (!pan.suppressed && Math.abs(pan.currentX - pan.startX) + Math.abs(pan.currentY - pan.startY) >= PAN_SUPPRESS_PX) {
16908
+ pan.suppressed = true;
16909
+ scrollContainerRef.current?.setAttribute("data-panning", "true");
16910
+ }
16906
16911
  if (pan.frameId !== null) return;
16907
16912
  pan.frameId = window.requestAnimationFrame(flushPanMove);
16908
16913
  };