primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.33k stars 1.22k forks source link

DatePicker: switching to year view when modelValue is populated #6203

Closed veco9 closed 2 months ago

veco9 commented 2 months ago

Describe the bug

It is not possible to switch to year picker when modelValue is populated (not empty).

Reproducer

https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-djt24u?file=src%2FApp.vue,src%2Fmain.ts

PrimeVue version

4.0.4

Vue version

4.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 126.0.6478.114 (64-bit)

Steps to reproduce the behavior

  1. Create basic datepicker in dom via (or go to https://primevue.org/datepicker/ under "Basic")
  2. Click on input and select some date
  3. Click on input once again and click on year shown as YYYY (to show year picker)
  4. Errors pops in console and year picker is not shown. Error: ReferenceError: value is not defined at Proxy.isYearSelected ....

Expected behavior

Year picker should be shown when clicking on year (e.g. 2024) regardless of modelValue being populated.

avramz commented 2 months ago

Can reproduce, fix pending in PR