Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I currently have an input with a ui-mask for a phone. If the value that is inputted isn't the full length of the mask, it clears the input. Is there a way to set the ui-mask so that it doesn't clear the input upon clicking or losing focus?

<input ui-mask="(999) 999-9999" type="text"/>
like image 604
Tyler Pflueger Avatar asked Dec 19 '14 21:12

Tyler Pflueger


1 Answers

You can set a ui-options attribute that sets the option:

<input ui-mask="(999) 999-9999" ui-options="{clearOnBlur: false}" type="text" />
like image 134
John Drouhard Avatar answered Sep 25 '22 00:09

John Drouhard