Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Fix text toolbar overflow (#1919)

Bogdan Chadkinb5a1b794e224
diff --git a/apps/builder/app/builder/features/workspace/canvas-tools/text-toolbar.tsx b/apps/builder/app/builder/features/workspace/canvas-tools/text-toolbar.tsx
index 4766ebb427..a2c38043df 100644
--- a/apps/builder/app/builder/features/workspace/canvas-tools/text-toolbar.tsx
+++ b/apps/builder/app/builder/features/workspace/canvas-tools/text-toolbar.tsx
@@ -67,7 +67,9 @@ const Toolbar = ({ state, onToggle }: ToolbarProps) => {
};
computePosition(reference, floating, {
placement: "top",
- middleware: [flip(), shift({ padding: 4 }), offset(12)],
+ // offset should be first for shift and flip
+ // to consider it while detecting overflow
+ middleware: [offset(12), shift({ padding: 4 }), flip()],
}).then(({ x, y }) => {
floating.style.transform = `translate(${x}px, ${y}px)`;
});
diff --git a/apps/builder/package.json b/apps/builder/package.json
index e60c6edc4f..599e4d3d61 100644
--- a/apps/builder/package.json
+++ b/apps/builder/package.json
@@ -17,7 +17,7 @@
"ci:migrate": "migrations migrate --force"
},
"dependencies": {
- "@floating-ui/dom": "^1.0.6",
+ "@floating-ui/dom": "^1.4.4",
"@fontsource/inter": "^4.5.15",
"@fontsource/manrope": "^4.5.13",
"@fontsource/roboto-mono": "^4.5.10",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3e5bfb2f42..e7258c144f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -49,8 +49,8 @@ importers:
apps/builder:
dependencies:
'@floating-ui/dom':
- specifier: ^1.0.6
- version: 1.0.6
+ specifier: ^1.4.4
+ version: 1.4.4
'@fontsource/inter':
specifier: ^4.5.15
version: 4.5.15
@@ -5056,22 +5056,12 @@ packages:
/@fal-works/[email protected]:
resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==}
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-Skfy0YS3NJ5nV9us0uuPN0HDk1Q4edljaOhRBJGDWs9EBa7ZVMYBHRFlhLvvmwEoaIM9BlH6QJFn9/uZg0bACg==}
- dev: false
-
/@floating-ui/[email protected]:
resolution: {integrity: sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==}
dev: false
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-kt/tg1oip9OAH1xjCTcx1OpcUpu9rjDw3GKJ/rEhUqhO7QyJWfrHU0DpLTNsH67+JyFL5Kv9X1utsXwKFVtyEQ==}
- dependencies:
- '@floating-ui/core': 1.0.2
- dev: false
-
- /@floating-ui/[email protected]:
- resolution: {integrity: sha512-VKmvHVatWnewmGGy+7Mdy4cTJX71Pli6v/Wjb5RQBuq5wjUYx+Ef+kRThi8qggZqDgD8CogCpqhRoVp3+yQk+g==}
+ /@floating-ui/[email protected]:
+ resolution: {integrity: sha512-21hhDEPOiWkGp0Ys4Wi6Neriah7HweToKra626CIK712B5m9qkdz54OP9gVldUg+URnBTpv/j/bi/skmGdstXQ==}
dependencies:
'@floating-ui/core': 1.3.1
dev: false
@@ -5082,7 +5072,7 @@ packages:
react: '>=16.8.0'
react-dom: '>=16.8.0'
dependencies:
- '@floating-ui/dom': 1.4.2
+ '@floating-ui/dom': 1.4.4
react: 18.2.0
react-dom: 18.2.0([email protected])
dev: false