Skip to content

Commit

Permalink
Merge pull request #5485 from nextcloud-libraries/fix/widgets--append…
Browse files Browse the repository at this point in the history
…-child-to-non-existing-widget

fix(NcReferenceWidget): do not try to render widget when there is no widget
  • Loading branch information
Antreesy authored Apr 12, 2024
2 parents dab6602 + f156a21 commit 87631ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/NcRichText/NcReferenceWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 87631ef

Please sign in to comment.