From a2442ad07740434e1862c22fcbd1e9fd729ed401 Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Mon, 27 Feb 2023 12:12:23 -0500 Subject: [PATCH] 19930: Check if richtext project description contains text to omit saving empty html tags Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- src/components/text-field/text-field.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/text-field/text-field.tsx b/src/components/text-field/text-field.tsx index 78e2c7fb..b2a8dd48 100644 --- a/src/components/text-field/text-field.tsx +++ b/src/components/text-field/text-field.tsx @@ -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() { -- 2.30.2