primefaces / primefaces/primereact
Calendar: Cannot paste new value when mask is present (keeps old value)
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When I have a mask on my Calendar component and I try to paste a valid date from my clipboard, I see that the new value that I'm trying to set doesn't show on any function like parseDateTime.
It looks like the library is deleting this value even before it makes it available to the api of any function (onChange, parseDateTime...).
Reproducer
https://stackblitz-starters-frufzshp.stackblitz.io
System Information
"primereact": "^10.9.2",
"react": "18.2.0",
Steps to reproduce the behavior
- Copy a valid date with this format 01/01/2005
- Paste it in the Calendar input box
- Watch it keeping the old value and not coming in the function parseDateTime
Expected behavior
I would expect the new value to be set in the Calendar input box
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Calendar component and reproduce the issue using the linked StackBlitz example: paste 01/01/2005 into a masked Calendar input and observe the existing value. Trace the paste and parsing flow to determine why the pasted date is discarded; done means the new date appears in the input and reaches parseDateTime or onChange.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100