From f1e9fe75ae8b233a6bcc48f18b2c2ab1685c79bf Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 31 May 2024 11:11:51 +0200 Subject: [PATCH] fix list description not updating properyl --- .../components/list-details.tsx | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/dashboard-refactor/search-results/components/list-details.tsx b/src/dashboard-refactor/search-results/components/list-details.tsx index 33b7063fac..4f33b4cc20 100644 --- a/src/dashboard-refactor/search-results/components/list-details.tsx +++ b/src/dashboard-refactor/search-results/components/list-details.tsx @@ -75,23 +75,15 @@ export default class ListDetails extends PureComponent { } } - // componentDidUpdate(prevProps: Props, prevState: State) { - // if ( - // prevState.isEditingDescription !== this.state.isEditingDescription - // ) { - // this.editorRef?.setEditable(this.state?.isEditingDescription) - - // if ( - // !this.editorRef?.checkIfHasContent() && - // !this.state?.isEditingDescription - // ) { - // this.setState({ shouldShowEditor: false }) - // } else if (this.state?.isEditingDescription) { - // this.setState({ shouldShowEditor: true }) - // this.editorRef.focus() - // } - // } - // } + componentDidUpdate(prevProps: Props, prevState: State) { + if (prevProps.description !== this.props.description) { + if (this.props.description != null) { + this.editorRef?.updateContentExternally(this.props.description) + } else { + this.editorRef?.updateContentExternally('') + } + } + } async componentWillUpdate(nextProps: Props, prevState: State) { if (this.props.listData.unifiedId !== nextProps.listData.unifiedId) {