From f156a2142ec5b355dc8336c537d9f22c1669e863 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Thu, 11 Apr 2024 12:07:51 +0200 Subject: [PATCH] fix(NcReferenceWidget): do not try to render widget when there is no widget Signed-off-by: Grigorii K. Shartsev --- src/components/NcRichText/NcReferenceWidget.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/NcRichText/NcReferenceWidget.vue b/src/components/NcRichText/NcReferenceWidget.vue index dbf9b93282..8c60c0885b 100644 --- a/src/components/NcRichText/NcReferenceWidget.vue +++ b/src/components/NcRichText/NcReferenceWidget.vue @@ -189,12 +189,16 @@ export default { this.renderWidget() }, renderWidget() { - if (this.$refs.customWidget) { - this.$refs.customWidget.innerHTML = '' + if (!this.$refs.customWidget) { + return } + if (this?.reference?.richObjectType === 'open-graph') { return } + + this.$refs.customWidget.innerHTML = '' + // create a separate element so we can rerender on the ref again const widget = document.createElement('div') this.$refs.customWidget.appendChild(widget)