Skip to content

Commit e8db1a8

Browse files
authored
Merge pull request #1196 from alexpopovme/fix-issue-1195
fix(VueDatePicker): menu not opening when centered prop is enabled
2 parents 193e117 + dfc0b4d commit e8db1a8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/VueDatePicker/VueDatePicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
118118
const slots = useSlots();
119119
const isOpen = ref(false);
120-
const shouldRender = ref(inline.value.enabled);
120+
const shouldRender = ref(inline.value.enabled || rootProps.centered);
121121
const modelValueRef = toRef(rootProps, 'modelValue');
122122
const timezoneRef = toRef(rootProps, 'timezone');
123123

src/VueDatePicker/__tests__/TestSuite_1.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,11 @@ describe('Test Suite 1', () => {
6060
expect(getMonthToggleBtn(dp).text()).toEqual(getMonthToggleText(nextMonth));
6161
});
6262
});
63+
64+
describe('centered option', () => {
65+
it('Should open menu when centered is enabled', async () => {
66+
const dp = await openMenu({ centered: true });
67+
expect(dp.find('.dp__menu').exists()).toBe(true);
68+
});
69+
});
6370
});

0 commit comments

Comments
 (0)