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: save custom background size (#3848)

Bogdan Chadkin8f7c78f3ba14
diff --git a/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-size.tsx b/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-size.tsx
index 48d01ae4f9..f2914c33b1 100644
--- a/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-size.tsx
+++ b/apps/builder/app/builder/features/style-panel/sections/backgrounds/background-size.tsx
@@ -55,13 +55,15 @@ export const BackgroundSize = (
const setValue = props.setProperty(property);
- const setValueX: SetValue = (valueX, options) => {
- const nextValue = toTuple(valueX, customSizeValue.value[1]);
+ const setValueX: SetValue = (value, options) => {
+ const [x] = value.type === "layers" ? value.value : [];
+ const nextValue = toTuple(x, customSizeValue.value[1]);
setValue(nextValue, options);
};
- const setValueY: SetValue = (valueY, options) => {
- const nextValue = toTuple(customSizeValue.value[0], valueY);
+ const setValueY: SetValue = (value, options) => {
+ const [y] = value.type === "layers" ? value.value : [];
+ const nextValue = toTuple(customSizeValue.value[0], y);
setValue(nextValue, options);
};