Skip to content

Commit 9cc131a

Browse files
authored
experimental: Fix inset reset (onAbort is called on blur) (#5105)
## Description 1. What is this PR about (link the issue and add a short description) ## 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 09f19b5 commit 9cc131a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/builder/app/builder/features/settings-panel/props-section/animation/animation-section.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,23 @@ export const AnimationSection = ({
389389
id={fieldIds.insetStart}
390390
value={value.insetStart ?? { type: "keyword", value: "auto" }}
391391
onChange={(insetStart, isEphemeral) => {
392+
if (insetStart === undefined) {
393+
handleChange(undefined, isEphemeral);
394+
return;
395+
}
396+
392397
handleChange({ ...value, insetStart }, isEphemeral);
393398
}}
394399
/>
395400
<InsetValueInput
396401
id={fieldIds.insetEnd}
397402
value={value.insetEnd ?? { type: "keyword", value: "auto" }}
398403
onChange={(insetEnd, isEphemeral) => {
404+
if (insetEnd === undefined) {
405+
handleChange(undefined, isEphemeral);
406+
return;
407+
}
408+
399409
handleChange({ ...value, insetEnd }, isEphemeral);
400410
}}
401411
/>

0 commit comments

Comments
 (0)