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.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
fix: Gradient code with var goes away after clicking out (#4703)
Ivan Starkov2a7304e4f403
diff --git a/apps/builder/app/builder/shared/code-editor-base.tsx b/apps/builder/app/builder/shared/code-editor-base.tsxindex d0abfe9aac..7c4c3c0b8c 100644--- a/apps/builder/app/builder/shared/code-editor-base.tsx+++ b/apps/builder/app/builder/shared/code-editor-base.tsx@@ -268,7 +268,6 @@ export const EditorContent = ({}, []);// setup editor-useEffect(() => {if (editorRef.current === null) {return;@@ -277,13 +276,17 @@ export const EditorContent = ({doc: "",parent: editorRef.current,});- if (autoFocus) {- view.focus();- }+viewRef.current = view;return () => {view.destroy();};+ }, []);++ useEffect(() => {+ if (autoFocus) {+ viewRef.current?.focus();+ }}, [autoFocus]);// update extensions whenever variables data is changed@@ -364,6 +367,7 @@ export const EditorContent = ({if (value === view.state.doc.toString()) {return;}+view.dispatch({changes: { from: 0, to: view.state.doc.length, insert: value },annotations: [ExternalChange.of(true)],@@ -376,6 +380,7 @@ export const EditorContent = ({if (view === undefined) {return;}+view.dispatch(view.state.replaceSelection(string));view.focus();},