Skip to content

Calendar: does not displays up-to-date value if date is manually entered #6984

@avasuro

Description

@avasuro

Describe the bug

If date is manually changed in Calendar (manually type date in date input), and then it got changed by some external code, e.g. "reset" button, then calendar still displays old value (the one that was entered manually).

Reproducer

https://codesandbox.io/p/sandbox/hopeful-moon-6q66wq

System Information

System:
OS: Windows 11 10.0.22621
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
Memory: 1.28 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.7.0 => 10.7.0
react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

In the demo above:

  1. Click on "calendar" icon and pick some date in date picker - new date will appear in date input
  2. Click on "reset" button - pay attention that date is empty now (this is expected)
  3. Now enter the same date as in step 1 but manually (type it inside input)
  4. Click on "reset" button - pay attention that date in date input will not change

Expected: date input should become empty, the same way as in step 2.

Expected behavior

Calendar should correctly sync displayed date in date input with the date passed in props.

Metadata

Metadata

Assignees

Labels

Type: BugIssue contains a defect related to a specific component.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions