File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/coreui-vue/src/components/carousel Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ const CCarousel = defineComponent({
119119 const nextItemWhenVisible = ( ) => {
120120 // Don't call next when the page isn't visible
121121 // or the carousel or its parent isn't visible
122- if ( ! document . hidden && isInViewport ( carouselRef . value ) ) {
122+ if ( ! document . hidden && carouselRef . value && isInViewport ( carouselRef . value ) ) {
123123 handleControlClick ( 'next' )
124124 }
125125 }
@@ -142,7 +142,7 @@ const CCarousel = defineComponent({
142142 }
143143
144144 const handleScroll = ( ) => {
145- if ( ! document . hidden && isInViewport ( carouselRef . value ) ) {
145+ if ( ! document . hidden && carouselRef . value && isInViewport ( carouselRef . value ) ) {
146146 visible . value = true
147147 } else {
148148 visible . value = false
You can’t perform that action at this time.
0 commit comments