8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isOnMobile
1 parent c97f86d commit 33fe7b7Copy full SHA for 33fe7b7
packages/coreui-vue/src/components/sidebar/CSidebar.ts
@@ -3,8 +3,13 @@ import { CBackdrop } from '../backdrop'
3
4
import { isInViewport } from '../../utils'
5
6
-const isOnMobile = (element: HTMLDivElement) =>
7
- Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'))
+const isOnMobile = (element?: HTMLDivElement) => {
+ if (!element) {
8
+ return
9
+ }
10
+
11
+ return Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'))
12
+}
13
14
const CSidebar = defineComponent({
15
name: 'CSidebar',
0 commit comments