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 {
13
13
14
14
const isVisible = ( element : HTMLDivElement ) => {
15
15
// 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
+ }
24
27
}
25
28
26
29
const CCarousel = defineComponent ( {
You can’t perform that action at this time.
0 commit comments