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.

refactor: Save content when content box is closed/blur (#3552)

Jaya Krishna Namburuef6cc5493162
diff --git a/apps/builder/app/builder/features/style-panel/shared/filter-content.tsx b/apps/builder/app/builder/features/style-panel/shared/filter-content.tsx
index c3fd09356d..5f504dcdc5 100644
--- a/apps/builder/app/builder/features/style-panel/shared/filter-content.tsx
+++ b/apps/builder/app/builder/features/style-panel/shared/filter-content.tsx
@@ -267,6 +267,11 @@ export const FilterSectionContent = ({
onChange={(value) =>
setIntermediateValue({ type: "intermediate", value })
}
+ onBlur={() => {
+ if (intermediateValue !== undefined) {
+ handleComplete(intermediateValue.value);
+ }
+ }}
onKeyDown={(event) => {
if (event.key === "Enter" && intermediateValue !== undefined) {
handleComplete(intermediateValue.value);
diff --git a/apps/builder/app/builder/features/style-panel/shared/shadow-content.tsx b/apps/builder/app/builder/features/style-panel/shared/shadow-content.tsx
index ac3fee29fc..d9e79fc81f 100644
--- a/apps/builder/app/builder/features/style-panel/shared/shadow-content.tsx
+++ b/apps/builder/app/builder/features/style-panel/shared/shadow-content.tsx
@@ -419,6 +419,7 @@ export const ShadowContent = ({
intermediateValue?.type === "invalid" ? "error" : undefined
}
onChange={handleChange}
+ onBlur={handleComplete}
onKeyDown={(event) => {
if (event.key === "Enter") {
handleComplete();