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: Space in navigation menu button trigger exits text editing (#4880)

Ivan Starkov5ae7ea624f4c
diff --git a/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx b/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx
index 235ed9548c..b79681bfe7 100644
--- a/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx
+++ b/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx
@@ -109,7 +109,7 @@ const ContentEditable = ({
// Issue: <button> with contentEditable does not allow pressing space.
// Solution: Add space on space keydown.
const abortController = new AbortController();
- if (rootElement.tagName === "BUTTON") {
+ if (rootElement.closest("button")) {
rootElement.addEventListener(
"keydown",
(event) => {