Why doesn't nz-input-number use type number #7655
-
in the input-number.component.ts file, this is how the input element is defined:
the type of the input element is not defined so it's defaulting to text, this allows the user to input non-numeric characters into the field, ng zorro handles that by removing non-numeric characters from the field, but why not use the default behavior of not allowing the user to input non-numeric character at all. any specific reason why the component was designed this way? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I'm just checking this issue and am wondering the same. Basically when the doc says |
Beta Was this translation helpful? Give feedback.
-
I'm not entirely certain why the initial decision was made against using type="number". However, I can offer some educated guesses:
I hope this provides some clarity on the subject. |
Beta Was this translation helpful? Give feedback.
-
Since this component needs to support formatter/parser, the input box should be of text type, not just numbers :) |
Beta Was this translation helpful? Give feedback.
Since this component needs to support formatter/parser, the input box should be of text type, not just numbers :)