Skip to content
This repository was archived by the owner on Dec 11, 2017. It is now read-only.

Only display mask delimiters when reached if empty placeholder#375

Closed
kcaran wants to merge 1 commit intodigitalBush:masterfrom
kcaran:noplaceholder
Closed

Only display mask delimiters when reached if empty placeholder#375
kcaran wants to merge 1 commit intodigitalBush:masterfrom
kcaran:noplaceholder

Conversation

@kcaran
Copy link

@kcaran kcaran commented Sep 15, 2016

See issue 361
https://github.com/digitalBush/jquery.maskedinput/issues/361

If the placeholder parameter is set to the empty string, don't display delimiting characters in the mask until they are reached by the input. For example, a (999) 999-9999 mask would display:

(
(6
(61
(617)
(617) 8

I've created a new test file, NoPlaceholder.Spec.js for this.

@aylacullen
Copy link

Excellent addition. What would need to be done to have it behave slightly differently: Example (using phone mask):

INPUT (user hasn't typed anything):
INPUT (used typed 1): (1
INPUT (user typed 2): (12
INPUT (user typed 3): (123)
INPUT (user typed 4): (123) 4
INPUT (user typed 5): (123) 45
INPUT (user typed 6): (123) 456
INPUT (user typed 7): (123) 456-7
...
INPUT (user typed 0): (123) 456-7890
INPUT (user typed 1): (123) 456-7890 x1
INPUT (user typed 2): (123) 456-7890 x12
INPUT (user typed 3): (123) 456-7890 x123
...etc

As you can see in above example, it'd be cleaner, I think.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants