Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker: View "year" throws error on year selection #6028

Closed
tibramo opened this issue Jul 8, 2024 · 14 comments
Closed

DatePicker: View "year" throws error on year selection #6028

tibramo opened this issue Jul 8, 2024 · 14 comments

Comments

@tibramo
Copy link

tibramo commented Jul 8, 2024

Describe the bug

The DatePicker with view "year", as in https://primevue.org/datepicker/#yearpicker, throws the following error upon year selection:

ReferenceError: value is not defined
    at Proxy.isYearSelected (DatePicker.ca76d316.js:358:8960)
    at year (DatePicker.ca76d316.js:358:2021)
    at Go (entry.8d61df7a.js:36:124976)
    at Dm (entry.8d61df7a.js:36:125192)
    at Proxy._getOptionValue (BaseComponent.54c219ea.js:1:4811)
    at Proxy.cx (BaseComponent.54c219ea.js:1:6791)
    at DatePicker.ca76d316.js:370:14830
    at Kv (entry.8d61df7a.js:16:11375)
    at DatePicker.ca76d316.js:370:14698
    at Object.r [as default] (entry.8d61df7a.js:16:3695)

After encountering this error, you cannot open the DatePicker again unless you manually clear the input field.

There seems to be a pull request to fix this: #5986

Reproducer

https://stackblitz.com/edit/nsj4av?file=src%2FApp.vue

PrimeVue version

4.0.0

Vue version

4.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Click on the input field
  2. Select a year

Expected behavior

No response

@tibramo tibramo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 8, 2024
@VictorBalbo
Copy link

The PR does look like it fixes the problem

@sandivsv
Copy link

I have also a same issue but one error is more when this (1st image) error come after that if we select any date then that time it gives a contineos loop of vue warning in console like (2nd img) , to remove this we have to only refresh
1st image image

2nd image
image

@HozSensei
Copy link

I've the same probleme :
image

If i initialise my model with new Date() i have error. If i don t define my model, everything is ok.

@gustavobmichel
Copy link

This is a fundamental bug that can be easily reproduced by going to the datepicker page and selecting a value. If you try to click on the year you will be prompted with the error above.

Screen.Recording.2024-07-18.155810.mp4

Given there's a PR to try and address it, is it possible to include in the upcoming versions? Thanks!

@Ancient-Dragon
Copy link
Contributor

@tugcekucukoglu please could you take a look at this bug, the open PR seems to fix the issue. Would be great to get it in a 4.0.2 release

@gustavobmichel
Copy link

I know this workaround might not work for everyone, but we have disabled the year selection via a css rule.

.p-datepicker-select-year {
  pointer-events: none;
}

We are working very hard to upgrade to PrimeVue 4 and having to rework the theme system so this will unblock us for now until we have a fix.

@rodriguez-ae
Copy link

Hi, Allan here! I'm from Guatemala and I'm working with the government as tech lead, currently we have the same problem specifically with the "Only Year Picker", Do you have any update about this issue? Thanks you so much.

@ghost
Copy link

ghost commented Aug 7, 2024

I agree with Rodriguez Ae. Currently we are working on a platform that relies on a PrimeVue frontend. And this is currently an on going issue with different projects at the Government.

@djuarezJS
Copy link

Hi, I urgently need to use the date picker only in Years if we could get an update on the issue it would be great.

@MynorSaban
Copy link

We are developing a platform with PrimeVue and have encountered the same issue with the "Only Year Picker"

@dinacuatro
Copy link

Have exactly the same problem, also need urgently the date picker to work in years mode, any due-date for fixing this bug?

@djuarezJS
Copy link

Have exactly the same problem, also need urgently the date picker to work in years mode, any due-date for fixing this bug?

hello i did this to make it work for the moment it has date format "yy" and the view is in month.

image

@Ancient-Dragon
Copy link
Contributor

@cagataycivici not sure if @tugcekucukoglu is away but please could we get this looked at? There is a PR with a fix that is ready for merging which would help a lot of us out!

@tugcekucukoglu tugcekucukoglu added this to the 4.0.5 milestone Aug 16, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Aug 16, 2024
@tugcekucukoglu
Copy link
Member

#6203

@tugcekucukoglu tugcekucukoglu removed this from the 4.0.5 milestone Aug 21, 2024
@tugcekucukoglu tugcekucukoglu removed their assignment Aug 21, 2024
@tugcekucukoglu tugcekucukoglu removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 21, 2024
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

No branches or pull requests