File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
packages/coreui-vue/src/components/carousel Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,17 @@ import {
1313
1414const isVisible = ( element : HTMLDivElement ) => {
1515 // check e ei not null to prevent error when leaving page
16- if ( ( element || "" ) === "" ) return false
17- const rect = element . getBoundingClientRect ( )
18- return (
19- rect . top >= 0 &&
20- rect . left >= 0 &&
21- rect . bottom <= ( window . innerHeight || document . documentElement . clientHeight ) &&
22- rect . right <= ( window . innerWidth || document . documentElement . clientWidth )
23- )
16+ try {
17+ const rect = element . getBoundingClientRect ( )
18+ return (
19+ rect . top >= 0 &&
20+ rect . left >= 0 &&
21+ rect . bottom <= ( window . innerHeight || document . documentElement . clientHeight ) &&
22+ rect . right <= ( window . innerWidth || document . documentElement . clientWidth )
23+ )
24+ } catch ( e :any ) {
25+ return false
26+ }
2427}
2528
2629const CCarousel = defineComponent ( {
You can’t perform that action at this time.
0 commit comments