From 1f2abfcd67813522c8347c94d94bdb8d94120e7e Mon Sep 17 00:00:00 2001 From: PaulSchult <40341262+PaulSchult@users.noreply.github.com> Date: Thu, 2 Dec 2021 12:50:48 +0100 Subject: [PATCH] fix: replace childElement when component is updated (fix #2028) (#2029) Co-authored-by: pschult --- apps/editor/src/ui/components/toolbar/customPopupBody.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/editor/src/ui/components/toolbar/customPopupBody.ts b/apps/editor/src/ui/components/toolbar/customPopupBody.ts index dfe9612b7d..2aec6f9c12 100644 --- a/apps/editor/src/ui/components/toolbar/customPopupBody.ts +++ b/apps/editor/src/ui/components/toolbar/customPopupBody.ts @@ -17,6 +17,11 @@ export class CustomPopupBody extends Component { this.refs.el.appendChild(this.props.body); } + updated(prevProps: Props) { + // update custom popup element + this.refs.el.replaceChild(this.props.body, prevProps.body); + } + render() { return html`
(this.refs.el = el)}>
`; }