Skip to content

Commit 23bbbb7

Browse files
committed
fix: Disable responsive check on shadow render
1 parent e8ea4a4 commit 23bbbb7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/VueDatePicker/components/DatepickerMenu.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
const { setMenuFocused, setShiftKey, control } = useState();
197197
const slots = useSlots();
198198
const { defaultedTextInput, defaultedInline, defaultedConfig, defaultedUI } = useDefaults(props);
199-
const { isMobile } = useResponsive(defaultedConfig);
199+
const { isMobile } = useResponsive(defaultedConfig, props.shadow);
200200
201201
const calendarWrapperRef = ref(null);
202202
const calendarWidth = ref(0);

src/VueDatePicker/composables/responsive.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { computed, type ComputedRef, onMounted, onUnmounted, ref } from 'vue';
22
import type { Config } from '@/interfaces';
33

4-
export const useResponsive = (config: ComputedRef<Config>) => {
4+
export const useResponsive = (config: ComputedRef<Config>, isShadow?: boolean) => {
55
const windowWidth = ref(0);
66

77
onMounted(() => {
@@ -17,7 +17,9 @@ export const useResponsive = (config: ComputedRef<Config>) => {
1717
windowWidth.value = window.document.documentElement.clientWidth;
1818
};
1919

20-
const isMobile = computed(() => (windowWidth.value <= config.value.mobileBreakpoint ? true : undefined));
20+
const isMobile = computed(() =>
21+
windowWidth.value <= config.value.mobileBreakpoint && !isShadow ? true : undefined,
22+
);
2123

2224
return {
2325
isMobile,

0 commit comments

Comments
 (0)