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(sheets-sort-ui): update default position calculation for custom sort dialog (#5600)

白熱6f545c33fb30
diff --git a/packages/design/package.json b/packages/design/package.json
index ec21df8872..ef85c2eb78 100644
--- a/packages/design/package.json
+++ b/packages/design/package.json
@@ -91,7 +91,7 @@
"tailwind-merge": "^3.3.1"
},
"devDependencies": {
- "@testing-library/jest-dom": "^6.6.3",
+ "@testing-library/jest-dom": "^6.6.4",
"@testing-library/react": "^16.3.0",
"@types/react-grid-layout": "^1.3.5",
"@types/react-transition-group": "^4.4.12",
diff --git a/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts b/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts
index b788e393a3..89f3571afa 100644
--- a/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts
+++ b/packages/sheets-sort-ui/src/controllers/sheets-sort-ui.controller.ts
@@ -43,6 +43,7 @@ import { SHEETS_SORT_ASC_EXT_ICON, SHEETS_SORT_ASC_ICON, SHEETS_SORT_CUSTOM_ICON
const CUSTOM_SORT_DIALOG_ID = 'custom-sort-dialog';
const CUSTOM_SORT_PANEL_WIDTH = 560;
+const CUSTOM_SORT_PANEL_TOP = 128;
export class SheetsSortUIController extends RxDisposable {
constructor(
@@ -136,8 +137,8 @@ export class SheetsSortUIController extends RxDisposable {
}
function getCustomSortDialogDefaultPosition(): { x: number; y: number } {
- const x = 0;
- const y = 0;
+ const x = (window.innerWidth - CUSTOM_SORT_PANEL_WIDTH) / 2;
+ const y = CUSTOM_SORT_PANEL_TOP;
return { x, y };
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index eb4ff50f54..003e2d6baa 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1248,8 +1248,8 @@ importers:
version: 3.3.1
devDependencies:
'@testing-library/jest-dom':
- specifier: ^6.6.3
- version: 6.6.3
+ specifier: ^6.6.4
+ version: 6.6.4
'@testing-library/react':
specifier: ^16.3.0
@@ -5644,6 +5644,10 @@ packages:
resolution: {integrity: sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==}
engines: {node: '>=14', npm: '>=6', yarn: '>=1'}
+ '@testing-library/[email protected]':
+ resolution: {integrity: sha512-xDXgLjVunjHqczScfkCJ9iyjdNOVHvvCdqHSSxwM9L0l/wHkTRum67SDc020uAlCoqktJplgO2AAQeLP1wgqDQ==}
+ engines: {node: '>=14', npm: '>=6', yarn: '>=1'}
+
'@testing-library/[email protected]':
resolution: {integrity: sha512-kFSyxiEDwv1WLl2fgsq6pPBbw5aWKrsY2/noi1Id0TK0UParSF62oFQFGHXIyaG4pp2tEub/Zlel+fjjZILDsw==}
engines: {node: '>=18'}
@@ -13479,6 +13483,16 @@ snapshots:
lodash: 4.17.21
redent: 3.0.0
+ '@testing-library/[email protected]':
+ dependencies:
+ '@adobe/css-tools': 4.4.2
+ aria-query: 5.3.2
+ css.escape: 1.5.1
+ dom-accessibility-api: 0.6.3
+ lodash: 4.17.21
+ picocolors: 1.1.1
+ redent: 3.0.0
+
dependencies:
'@babel/runtime': 7.27.1