diff --git a/demo/scripts/controlsV2/sidePane/contentModel/components/format/formatPart/TextColorFormatRenderer.ts b/demo/scripts/controlsV2/sidePane/contentModel/components/format/formatPart/TextColorFormatRenderer.ts index 2da01dcfc71..e6251ee016a 100644 --- a/demo/scripts/controlsV2/sidePane/contentModel/components/format/formatPart/TextColorFormatRenderer.ts +++ b/demo/scripts/controlsV2/sidePane/contentModel/components/format/formatPart/TextColorFormatRenderer.ts @@ -7,7 +7,13 @@ export const TextColorFormatRenderer: FormatRenderer = createCo TextColorFormat >( 'Text color', - format => (format.textColor ? Color(format.textColor).hex() : ''), + format => { + try { + return format.textColor ? Color(format.textColor).hex() : ''; + } catch (e) { + console.log(e); + } + }, (format, value) => { format.textColor = value; return undefined; diff --git a/demo/scripts/controlsV2/sidePane/contentModel/components/format/utils/createTextFormatRenderer.tsx b/demo/scripts/controlsV2/sidePane/contentModel/components/format/utils/createTextFormatRenderer.tsx index 2d61fe4a096..3b3260fde69 100644 --- a/demo/scripts/controlsV2/sidePane/contentModel/components/format/utils/createTextFormatRenderer.tsx +++ b/demo/scripts/controlsV2/sidePane/contentModel/components/format/utils/createTextFormatRenderer.tsx @@ -20,7 +20,7 @@ function TextFormatItem(props: { (newValue: string) => { setValue(newValue); setter?.(format, newValue); - onUpdate(); + onUpdate?.(); }, [setter, format] );