diff --git a/assets/js/src/form_editor/blocks/input_styles_settings.jsx b/assets/js/src/form_editor/blocks/input_styles_settings.jsx index 37fdecf669..fd8da15d9d 100644 --- a/assets/js/src/form_editor/blocks/input_styles_settings.jsx +++ b/assets/js/src/form_editor/blocks/input_styles_settings.jsx @@ -28,6 +28,22 @@ const InputStylesSettings = ({ onChange(updated); localStylesRef.current = updated; }; + + const updateInheritFromTheme = (newValue) => { + if (newValue) { + updateStyles('inheritFromTheme', newValue); + return; + } + const updated = { ...localStylesRef.current }; + updated.bold = false; + updated.borderRadius = 1; + updated.borderSize = 1; + updated.borderColor = 'black'; + updated.inheritFromTheme = newValue; + onChange(updated); + localStylesRef.current = updated; + }; + return ( @@ -40,7 +56,7 @@ const InputStylesSettings = ({ {!localStyles.inheritFromTheme ? ( diff --git a/assets/js/src/form_editor/blocks/submit/styles_settings.tsx b/assets/js/src/form_editor/blocks/submit/styles_settings.tsx index 015729a4be..4b0062d1b4 100644 --- a/assets/js/src/form_editor/blocks/submit/styles_settings.tsx +++ b/assets/js/src/form_editor/blocks/submit/styles_settings.tsx @@ -42,6 +42,21 @@ const StylesSettings = ({ localStylesRef.current = updated; }; + const updateInheritFromTheme = (newValue: boolean) => { + if (newValue) { + updateStyles('inheritFromTheme', newValue); + return; + } + const updated = { ...localStylesRef.current }; + updated.bold = false; + updated.borderRadius = 1; + updated.borderSize = 1; + updated.borderColor = 'black'; + updated.inheritFromTheme = newValue; + onChange(updated); + localStylesRef.current = updated; + }; + return ( @@ -54,7 +69,7 @@ const StylesSettings = ({ {!localStyles.inheritFromTheme ? (