Skip to content

Conversation

@alexpopovme
Copy link
Contributor

Describe your changes

The datepicker menu did not open when the centered prop was enabled because shouldRender was initialized as false for all non-inline modes. This prevented the menu from rendering when isOpen became true.

This PR updates the initialization so that shouldRender becomes true when either inline.enabled or rootProps.centered is active. This ensures the menu opens correctly in centered mode.

A minimal unit test was added to verify that the menu renders when centered: true is enabled.

Issue ticket number and link

Fixes #1195

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have ensured that unit tests pass without errors
  • I have added or updated unit tests when needed

When the centered prop is enabled, the datepicker menu does not open after clicking the input. The issue was caused by the shouldRender ref being initialized as false for non-inline modes, preventing the menu from rendering even when isOpen was true.

Modified shouldRender initialization to include rootProps.centered condition. Now shouldRender is true when either inline.enabled or rootProps.centered is active. The existing watcher logic remains unchanged and only affects floating (non-centered, non-inline) mode.

Added test case to verify menu opens correctly in centered mode.

Changes:
- VueDatePicker.vue
- TestSuite_1.spec.ts

Fixes #1195
@Jasenkoo Jasenkoo merged commit e8db1a8 into Vuepic:main Nov 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datepicker menu does not open when centered is enabled

2 participants