Skip to content

Loading…

Masked field gets repopulated with previous input on focus #73

Closed
gidili opened this Issue · 5 comments

3 participants

@gidili

I have a very simple optional numerical only field:

$('#value').mask("?9999", {placeholder:"-"});

This works OK, but at some stage in the flow I need to wipe the field from the given value the user filled in. This is also OK, but as soon as the user tabs in (or any time the focus event is triggered) the value that was on the field before it was wiped comes back with the exception of the first character that gets replaced by the placeholder (I tried with various placeholders).

So to summarize:

1) user fills in "1234"
2) I retrieve the value and programmatically wipe the field to initialize another transaction
3) user focuses on field again during the new transaction
4) input goes back to "-234" (should go back to "----" or whatever the placeholder is)

Is this a known issue or a new bug or am I using it the wrong way?

@alexladeira

I have a similar problem here. Someone is working on it, or even validate this as a bug?

@gidili

I haven't heard anything about this since I logged the issue. Had to drop masking.

@alexladeira

What works for me is to unmask and then mask the input again.

@gidili

@alexladeira good to know - thanks for sharing :)

@digitalBush
Owner

@JohnIdol Sorry for the late response. This is expected if you are changing the input value programmatically without resetting the mask. This is a side effect of the internal buffer the plugin maintains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.