Skip to content

Commit

Permalink
refactor: remove variable fallback on autocomplete (#4521)
Browse files Browse the repository at this point in the history
Forgot to clear fallback after variable values preview.

<img width="335" alt="Screenshot 2024-12-06 at 13 40 03"
src="https://github.com/user-attachments/assets/0d35bcbe-f890-4082-9da1-e194645ad1bb">
  • Loading branch information
TrySound authored Dec 6, 2024
1 parent ce2babe commit 4991ec4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,16 @@ export const CssValueInput = ({
}

if (value.type !== "intermediate" && value.type !== "invalid") {
// variables fallback is used for preview value while autocompleting
// removed fallback when select variable to not pollute values
let newValue = value;
if (value.type === "var") {
newValue = { ...value };
delete newValue.fallback;
}
// The value might be valid but not selected from the combo menu. Close the menu.
closeMenu();
props.onChangeComplete({ ...defaultProps, ...event, value });
props.onChangeComplete({ ...defaultProps, ...event, value: newValue });
return;
}

Expand Down

0 comments on commit 4991ec4

Please sign in to comment.