19930: Check if richtext project description contains text to omit saving empty html...
authorStephen Smith <stephen@curii.com>
Mon, 27 Feb 2023 17:12:23 +0000 (12:12 -0500)
committerStephen Smith <stephen@curii.com>
Mon, 27 Feb 2023 17:12:23 +0000 (12:12 -0500)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/components/text-field/text-field.tsx

index 78e2c7fbedc3f5ac64ecd5aab9328e7532a77e16..b2a8dd4848602a24eb66fba407f545d0cf992c35 100644 (file)
@@ -72,7 +72,11 @@ export const RichEditorTextField = withStyles(styles)(
 
         onChange = (value: any) => {
             this.setState({ value });
-            this.props.input.onChange(value.toString('html'));
+            this.props.input.onChange(
+                !!value.getEditorState().getCurrentContent().getPlainText().trim()
+                ? value.toString('html')
+                : null
+            );
         }
 
         render() {