Skip to content

Commit 727dcb6

Browse files
committed
fix(CSidebar): update interesction observer to work properly when visible property is not provided
1 parent 8278539 commit 727dcb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/sidebar/CSidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const CSidebar = defineComponent({
8383

8484
const callback = (entries: IntersectionObserverEntry[]) => {
8585
entries.forEach((entry) => {
86-
if (entry.isIntersecting !== props.visible) {
86+
if (entry.isIntersecting !== props.visible || typeof visible.value === 'undefined') {
8787
visible.value = entry.isIntersecting
8888
emit('visible-change', visible.value)
8989
}

0 commit comments

Comments
 (0)