-
-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
Describe the bug
If a input with type="number" has the v-mask directive, even if we not pass any mask, the input does not accept typing a .. The directive should not be enabled if an incompatible type is used, like the number.
Steps to reproduce
- Create a input with
type=numberandv-mask="null" - Type a number, then
.. Like:16.. The.will not be rendered.
Suggestion
The documentation of maska tells the types that are compatible, but the directive only checks if the type is not a file type. The correct solution would be to only enable with the compatible types.
const allowedTypes = ['text', 'search', 'url', 'tel', 'password'];
const input = el instanceof HTMLInputElement ? el : el.querySelector('input');
if (input == null || !allowedTypes.includes(input.type)) return;
List of compatible types on the documentation: https://beholdr.github.io/maska/v3/#/issues?id=unsupported-input-types
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels