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: manual input value is wrongly corrected when typing #6099

Closed
idzmag opened this issue Mar 6, 2024 · 4 comments · Fixed by #6478
Closed

Calendar: manual input value is wrongly corrected when typing #6099

idzmag opened this issue Mar 6, 2024 · 4 comments · Fixed by #6478
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@idzmag
Copy link

idzmag commented Mar 6, 2024

Describe the bug

Using dateFormat="yy.mm.dd" type "2024.03." and next start typing "18" or something like that. After you type "1" the date is set to 2024.03.01 and makes typing "18" here impossible.

Reproducer

https://stackblitz.com/edit/vitejs-vite-uz69pt?file=src%2FApp.tsx

PrimeReact version

10.5.1

React version

18.x

Language

ES6

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Start typing in Calendar 2024.03.
  2. Try to type 18 next
  3. NOT OK - input is changed to 2024.03.01

Expected behavior

Parsing the date should be done only if provided input matches the format, so if dd is at the end .1 should not become .01 automatically

@idzmag idzmag added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 6, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 6, 2024
@KirilCycle
Copy link
Contributor

@melloware Hello! I want to try this, can u verify my solution please

Accept next digit, and move previous to start, when input is filled

For example you want to type 2024.03.18, after typing '1' to 2024.03
this will update input to 2024.03.01 and after entering '8', this will shift first dig '0' in cur cel, and then move last entered digits to achieve 2024.03.18

@melloware
Copy link
Member

@KirilCycle this one is complex but you are welcome to submit a PR so we can test it?

@KirilCycle
Copy link
Contributor

vueprime works fine at this case, i should take a look at their code base

@melloware
Copy link
Member

Good idea to review PrimeVue and compare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants