Skip to content

Commit 5ae7ea6

Browse files
authored
fix: Space in navigation menu button trigger exits text editing (#4880)
## Description closes #4879 ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent b4c1ffd commit 5ae7ea6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const ContentEditable = ({
109109
// Issue: <button> with contentEditable does not allow pressing space.
110110
// Solution: Add space on space keydown.
111111
const abortController = new AbortController();
112-
if (rootElement.tagName === "BUTTON") {
112+
if (rootElement.closest("button")) {
113113
rootElement.addEventListener(
114114
"keydown",
115115
(event) => {

0 commit comments

Comments
 (0)