-
Notifications
You must be signed in to change notification settings - Fork 301
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
type='number' on masked input - Throws error on focus and text entry #877
Comments
Changing the type to be "tel" should do what you want to |
@ColinMorris83 I appreciate the tip! I would not be able to use the native stepper then, is that use case not possible? |
Correct, I think if you require to have the native stepper then only type of number provides that, and that will need code changes in the library to check if input supports selection before certain pieces of code are run |
Ok, that makes sense. This seems to be the location of the click event that errors, probably a good place to start: https://github.com/JsDaddy/ngx-mask/blob/develop/projects/ngx-mask-lib/src/lib/mask.directive.ts#L296 Could you elaborate on what kinds of code can't be run on number inputs? Thank you! |
I only know of selection functions which is mentioned here for what type of inputs support them: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange |
Still actual for |
Duplicate of #644 |
@JWess @de-don @ColinMorris83 @z-svoboda-mob Thanks for using Ngx-mask. Please update to latest version. |
🐞 bug report
Is this a regression?
No, the issue occurs on 11.1.5 and 11.0.0
Description
Using
input type='number'
with a mask ofmask='0'
throws an error on focus and on text entry.It appears to work correctly otherwise.
I am using input type to trigger the number keyboard on mobile devices.
🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-ivy-zd58bk?devtoolsheight=33&file=src/app/app.component.html
🔥 Exception or Error
Chrome:
On focus:
On text entry:
Firefox
Same error for focus and text entry:
🌍 Your Environment
Angular Version:
The text was updated successfully, but these errors were encountered: