Skip to content

Optional digits with clearIfNotMatch enabled #592

Open
@GagnonVincent

Description

@GagnonVincent

This is the mask I created for an office phone number.

$('#phone-office').mask("(000) 000-0000 9999", { clearIfNotMatch: true });
See on Fiddle

The last four digits are the phone extension and have to be optional. If there is no extension, the mask should remains the value but it clears it. The mask keep the value only if I add a space at the end.

Typed : 5141234567
Should be : (514) 123-4567

Is this the normal behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions