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.

move onKeyPress into props getter to make sure we don't override a handler

Oleg Isonen1063cb743ef7
diff --git a/apps/designer/app/designer/features/props-panel/props-panel.tsx b/apps/designer/app/designer/features/props-panel/props-panel.tsx
index 888e8833d7..2b994f6d8d 100644
--- a/apps/designer/app/designer/features/props-panel/props-panel.tsx
+++ b/apps/designer/app/designer/features/props-panel/props-panel.tsx
@@ -66,7 +66,13 @@ export const Combobox = ({
<Box {...getComboboxProps()}>
<ComboboxPopperAnchor>
<TextField
- {...getInputProps()}
+ {...getInputProps({
+ onKeyPress: (event) => {
+ if (event.key === "Enter") {
+ onSubmit(event.currentTarget.value);
+ }
+ },
+ })}
name="prop"
placeholder="Property"
readOnly={isReadonly}
@@ -76,11 +82,6 @@ export const Combobox = ({
<ChevronDownIcon />
</IconButton>
}
- onKeyPress={(event) => {
- if (event.key === "Enter") {
- onSubmit(event.currentTarget.value);
- }
- }}
/>
</ComboboxPopperAnchor>
<ComboboxPopperContent align="start" sideOffset={5}>