igxMask directive doesn't work with input[type="number"].
Description
igxMask directive doesn't work with input[type="number"].
Steps to reproduce
- Go to https://stackblitz.com/edit/igx-editors-issue
- Open console panel.
- Focus a number input.
- Type any characters in it
Result
-
promptChardoesn't work. -
Errors occur.
ERROR Error: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection. Error: Converting circular structure to JSON
Expected result
igxMask directive should work with input[type="number"].
The problem is that setSelectionRange method i no longer allowed on input of type number, as described in this post. I can provide a fix for this problem, but I would recommend not using igxMask on input of type number, use text or tel if possible.. Please let me know if this is critical for your scenario.
igxMask directive is meant to work only with input[type="string"]. It's possible that it will work correctly with other input types but we don't guarantee that. We will document this limitation.
@SAndreeva @bkulov thank you for explaining. I understand.
I am able to see the limitation in the following document. https://www.infragistics.com/products/ignite-ui-angular/angular/components/mask.html
igxMask directive is used on an input of type text. To get started with the Ignite UI for Angular Mask directive, let's first import the IgxMaskModule and IgxInputGroupModule in our app.module.ts file.
But what about README.md? https://github.com/IgniteUI/igniteui-angular/tree/master/src/directives/mask
I have updated the README.md file accordingly. Thanks!
@SAndreeva thank you!