Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheet): change sheet tab trigger alert (#839)

Dushusir0a154800bfc3
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx
index b288e47b25..f7c1f025c4 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.tsx
@@ -148,7 +148,8 @@ export function SheetBarTabs() {
const workbook = univerInstanceService.getCurrentUniverSheetInstance();
const worksheet = workbook.getActiveSheet();
const currenSheetName = worksheet.getName();
- if (currenSheetName === name) return true;
+ // TODO@Dushusir: no need trigger save
+ if (currenSheetName === name) return false;
const checked = workbook.checkSheetName(name);
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.ts b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.ts
index 3512dd400e..dd18729075 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.ts
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.ts
@@ -451,6 +451,11 @@ export class SlideTabBar {
let lastPageY = 0;
let lastTime = 0;
this._downAction = (downEvent: MouseEvent) => {
+ // Waiting for the rename of the previous TAB
+ if (this._activeTabItem?.isEditMode()) {
+ return;
+ }
+
const slideItemId = (downEvent.target as HTMLElement)
?.closest(`.${config.slideTabBarItemClassName}`)
?.getAttribute('data-id');