diff --git a/common/changes/@visactor/vtable/3161-refactor-gantt-taskbar-resize_2024-12-23-07-54.json b/common/changes/@visactor/vtable/3161-refactor-gantt-taskbar-resize_2024-12-23-07-54.json new file mode 100644 index 000000000..f0ea087f2 --- /dev/null +++ b/common/changes/@visactor/vtable/3161-refactor-gantt-taskbar-resize_2024-12-23-07-54.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: gantt taskbar resize width interaction can not limit one time unit #3161\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file diff --git a/packages/vtable-gantt/src/state/state-manager.ts b/packages/vtable-gantt/src/state/state-manager.ts index 6893eba2a..bbe9111cc 100644 --- a/packages/vtable-gantt/src/state/state-manager.ts +++ b/packages/vtable-gantt/src/state/state-manager.ts @@ -661,15 +661,9 @@ export class StateManager { const progress = taskRecord[progressField]; let diffWidth = this._gantt.stateManager.resizeTaskBar.onIconName === 'left' ? -dx : dx; - let taskBarSize = taskBarGroup.attribute.width + diffWidth; - if (diffWidth < 0 && taskBarSize <= this._gantt.parsedOptions.timelineColWidth) { - diffWidth = this._gantt.parsedOptions.timelineColWidth - taskBarGroup.attribute.width; - taskBarSize += diffWidth; - } - // taskBarGroup.setAttribute('width', taskBarSize); - // if (this._gantt.stateManager.resizeTaskBar.onIconName === 'left') { - // taskBarGroup.setAttribute('x', taskBarGroup.attribute.x - diffWidth); - // } + const taskBarSize = Math.max(1, taskBarGroup.attribute.width + diffWidth); + diffWidth = taskBarSize - taskBarGroup.attribute.width; + resizeOrMoveTaskBar( taskBarGroup, this._gantt.stateManager.resizeTaskBar.onIconName === 'left' ? -diffWidth : 0,