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.

use isEphemeral in scrub control onChange handler as well

Sultan95af6650c069
diff --git a/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx b/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx
index c5d5784f3a..21fb943af4 100644
--- a/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx
+++ b/apps/designer/app/designer/features/style-panel/controls/text/text-control.tsx
@@ -116,11 +116,19 @@ export const TextControl = ({
<IconButton
onPointerEnter={(event) => {
if (value.type !== "unit") return;
+ const target = event.target as HTMLInputElement;
numericScrubRef.current =
numericScrubRef.current ||
- numericScrubControl(event.target as HTMLInputElement, {
+ numericScrubControl(target, {
+ minValue: 0,
initialValue: value.value as number,
- onValueChange: ({ value }) => setValue(String(value)),
+ onValueChange: ({ value }) => {
+ const input = target.parentElement?.querySelector(
+ ":scope > input"
+ ) as HTMLInputElement;
+ input.value = String(value);
+ setValue(String(value), { isEphemeral: true });
+ },
});
}}
onPointerLeave={() => {