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

Calendar: incorrect value is displayed #7428

Open
avasuro opened this issue Nov 18, 2024 · 0 comments
Open

Calendar: incorrect value is displayed #7428

avasuro opened this issue Nov 18, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@avasuro
Copy link
Contributor

avasuro commented Nov 18, 2024

Describe the bug

If the date in the onChange handler of the Calendar was not updated in external state, the calendar shows incorrect date in date input.

Reproducer

https://codesandbox.io/p/sandbox/primereact-calendar-displays-incorrect-value-if-new-value-was-not-applied-in-onchange-sw2547

System Information

System:
    OS: Windows 11 10.0.22621
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
    Memory: 3.68 GB / 15.71 GB
  Binaries:
    Node: 18.20.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    primereact: 10.8.4 => 10.8.4
    react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

  1. Open demo
  2. Click on calendar input and select some date with a mouse
  3. Confirmation dialog will appear - click "No" there

Actual behavior: some date is displayed inside the input
Expected behavior: no date should be displayed inside the input

If you click on date input again - date will disappear, as it should be.

Expected behavior

Calendar component should take into account the date provided in props all the time, even if this date wasn't changed

@avasuro avasuro added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant