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

Component: InputMask – AutoClear moves value to front #16605

Open
DaSchTour opened this issue Oct 21, 2024 · 3 comments
Open

Component: InputMask – AutoClear moves value to front #16605

DaSchTour opened this issue Oct 21, 2024 · 3 comments
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Milestone

Comments

@DaSchTour
Copy link

Describe the bug

When inputing a value in the middle of an inputmask the value is shifted to the beginning.
In the example I have a something like a data mask mm/dd/yyyy and input only mm/09/yyyy on blur this becomes 09/dd/yyyy

Environment

Nothing special, just using inputmask with autoclear set to off

Reproducer

https://stackblitz.com/edit/stackblitz-starters-fm32vs?file=src%2Fmain.ts

Angular version

18.1.0

PrimeNG version

17.18.11

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.20.3

Browser(s)

No response

Steps to reproduce the behavior

  1. Focus a inputmask field with autoclear false
  2. Type in some part of the value not at the start
  3. Blur/Unfocus/Leave the input field
  4. See the value shift to the start

Expected behavior

The value is preserved as it is

@DaSchTour DaSchTour added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 21, 2024
@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 19, 2024
@mertsincan mertsincan added this to the Future milestone Nov 19, 2024
Copy link

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

@DaSchTour
Copy link
Author

@mertsincan I would like to fix this issue, but currently unit testing is completely broken so I have no idea how contribution is possible at the moment. That's really frustrating. I would have fixed this issue weeks ago if I would now how to contribute.

@cezeta-hub
Copy link

cezeta-hub commented Dec 10, 2024

To add to this problem, if the pattern has a fixed value somewhere in it, the fixed value will be inserted and moved up front too.

i.e., given the pattern "9999999-001" with [autoClear]="false", on focus the input will show _______-001. On blur, the input will show 001____-001. If you focus->blur again: 001001_-001 and so on.

@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Projects
Status: Review
Development

No branches or pull requests

3 participants