diff --git a/src/VueDatePicker/VueDatePicker.vue b/src/VueDatePicker/VueDatePicker.vue index 66e3816d..2a71485e 100644 --- a/src/VueDatePicker/VueDatePicker.vue +++ b/src/VueDatePicker/VueDatePicker.vue @@ -117,7 +117,7 @@ const slots = useSlots(); const isOpen = ref(false); - const shouldRender = ref(inline.value.enabled); + const shouldRender = ref(inline.value.enabled || rootProps.centered); const modelValueRef = toRef(rootProps, 'modelValue'); const timezoneRef = toRef(rootProps, 'timezone'); diff --git a/src/VueDatePicker/__tests__/TestSuite_1.spec.ts b/src/VueDatePicker/__tests__/TestSuite_1.spec.ts index d2bc2fa2..8e99f5f8 100644 --- a/src/VueDatePicker/__tests__/TestSuite_1.spec.ts +++ b/src/VueDatePicker/__tests__/TestSuite_1.spec.ts @@ -60,4 +60,11 @@ describe('Test Suite 1', () => { expect(getMonthToggleBtn(dp).text()).toEqual(getMonthToggleText(nextMonth)); }); }); + + describe('centered option', () => { + it('Should open menu when centered is enabled', async () => { + const dp = await openMenu({ centered: true }); + expect(dp.find('.dp__menu').exists()).toBe(true); + }); + }); });