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

Defined input [hiddenInput] doesn't allow to substitute entered value with a new one #1203

Closed
ao1is opened this issue Jul 31, 2023 · 1 comment
Labels

Comments

@ao1is
Copy link

ao1is commented Jul 31, 2023

🐞 bug report

Is this a regression?

Yes, the previous version in which this bug was not present was:

16.2.3 - for case 1
14.0.1 - for case 2 and 3

Description

Common steps

  1. Define simple mask like [mask]="'9999999999999'"
  2. Provide input [hiddenInput] with any boolean value (doesn't matter): [hiddenInput]="false" or [hiddenInput]="true"

Case 1 (latest working version is 16.2.3)

  1. Enter value '12' into the input.
  2. Select the entered value and press '1'
  3. Actual: Value in the input and model set to '2'.
    Expected: Value in input and model should be changed to '1'
    Demo: https://www.screencast.com/t/qxt8zT9h1J6j

Case 2 (latest working version is 14.0.1)

  1. Enter value '111' into the input.
  2. Copy from somewhere string '222' into the buffer.
  3. Select the entered '111' value in the input.
  4. Substitute selected value from the input with copied '222' by Ctrl+V.
  5. Actual: Nothing changed.
    Expected: Value in the input and model should be changed to '222'
    Demo: https://www.screencast.com/t/jzVUncKe

Case 3 (latest working version is 14.0.1)

  1. Enter value '111' into the input.
  2. Copy from somewhere string '555555' (the string's length shouldn't match with length of the entered value) into the buffer .
  3. Select the entered '111' value in the input.
  4. Substitute selected value from the input with copied '555555' by Ctrl+V.
  5. Actual: Value in the input and model set to '5111'.
    Expected: Value in the input and model should be changed to '555555'
    Demo: https://www.screencast.com/t/dxuaf3d4Tg0X

All cases work good without defined [hiddenInput] or when [hiddenInput]="undefined"

🔬 Minimal Reproduction

Sample: https://stackblitz.com/edit/ngx-mask-hidden-input-bug?file=src%2Fmain.ts

🌍 Your Environment

Angular Version: 16.1.7
Chrome Version: 115.0.5790.110

@andriikamaldinov1
Copy link
Collaborator

@ao1is Thanks for your using Ngx-Mask. Please update to latest version.
It example, all work as expected - https://stackblitz.com/edit/ngx-mask-hidden-input-bug-rsuf9m?file=src%2Fmain.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants