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: let user type "auto" into duration input (#5343)

Bogdan Chadkin9409657219c8
diff --git a/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.tsx b/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.tsx
index 606f2123b0..bb14e767ff 100644
--- a/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.tsx
+++ b/apps/builder/app/builder/features/settings-panel/props-section/animation/animation-panel-content.tsx
@@ -262,6 +262,12 @@ const DurationInput = ({
onChangeComplete={(event) => {
const value = durationUnitValueSchema.safeParse(event.value);
onChange(undefined, true);
+ // allow user to reset with initial value
+ if (toValue(event.value).toLowerCase() === "auto") {
+ onChange(undefined, false);
+ setIntermediateValue(undefined);
+ return;
+ }
if (value.success) {
onChange(value.data, false);
setIntermediateValue(undefined);