From 2cd7640f66f6b36ef959b6dc4e55013ebc3ab05f Mon Sep 17 00:00:00 2001 From: Yohanes Date: Mon, 24 Mar 2025 22:52:34 +0700 Subject: [PATCH] fix: prevent unnecessary bar position updates Only update the bar position when the snap position has actually changed to avoid redundant updates and improve performance. --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index 054d3e2ce..9e40310fa 100644 --- a/src/index.js +++ b/src/index.js @@ -1281,7 +1281,12 @@ export default class Gantt { bars.forEach((bar) => { const $bar = bar.$bar; + const tempdx = $bar.finaldx; $bar.finaldx = this.get_snap_position(dx, $bar.ox); + + //better to update when position of x axis is changed + if (tempdx === $bar.finaldx) return; + this.hide_popup(); if (is_resizing_left) { if (parent_bar_id === bar.task.id) {