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

Changing hidden input breaks the entered value again #1449 #1455

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

BGBRWR
Copy link
Contributor

@BGBRWR BGBRWR commented Nov 11, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:
  • Updated Type Testing to mimic browser behavior (events) since the testing suite does not have a browser.

What is the current behavior?

Issue Number: #1449

What is the new behavior?

While setting hiddenInput to null use to do the trick it doesn't anymore. And setting hiddenInput to false will clash with parameters of the ngx-mask. The updated testing reveals some of those issues and null checking hiddenInput doesn't fix them all. These changes do.

There is a new PasteTest function and new behavior for TypeTest. They mimic the events that would occur with a human using the ngx-mask input in a browser. This shows several breaking test cases and including the ones in secure-mask.spec.ts that should be broken with the changes in 18.0.1. I also updated some of the specs test cases to pass while keeping each test cases' intentions.

Now the code will check if there are symbol_stars (*) in the value to process the input back to its true value when hiddenInput is false.

I also fix a issue with inputs with multiple mask types and those masks have specialCharacters (UK POST - S0 0SS||SAA 0SS||SS0A 0SS). It wasn't selecting the correct mask type on typing. Demo here: https://stackblitz.com/edit/stackblitz-starters-n8bkaa?file=src%2Fmain.ts

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Please let me know if you have feedback or questions.

TypeTest now mimics true typing since there isn't a browser with the testing suite.
This is needed with inputs with multiple mask types and they have specialCharacters in the mask.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant