Skip to content

Commit

Permalink
fix(NcReferenceWidget): pass elements to intersection observer
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad committed Jul 1, 2024
1 parent 7890745 commit 23d82a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/NcRichText/NcReferenceWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ export default {
const widgetRoot = ref()
const { width } = useElementSize(widgetRoot)

useIntersectionObserver(widgetRoot, () => {
nextTick(() => {
isVisible.value = widgetRoot.value?.isIntersecting ?? false
useIntersectionObserver(widgetRoot, (entries) => {
entries.forEach(entry => {
nextTick(() => {
isVisible.value = entry.isIntersecting
})
})
})

Expand Down

0 comments on commit 23d82a3

Please sign in to comment.