How to set autoclear on angular ui-mask to false?

Currently, I have an input with a ui mask for the phone. If the entered value is not the full length of the mask, it clears the input. Is there a way to set u-mask so that it does not clear the input when pressed or lost focus?

<input ui-mask="(999) 999-9999" type="text"/> 
+6
source share
2 answers

You can set the ui-options attribute, which sets the parameter:

 <input ui-mask="(999) 999-9999" ui-options="{clearOnBlur: false}" type="text" /> 
+13
source

I really did not find the exact answer I wanted, but this is the solution I went with.

 <input ui-mask="?(999) 999-9999" type="text"/> 

Just so that I can use ui-mask and it doesn't clear the field.

0
source

Source: https://habr.com/ru/post/979962/


All Articles