reactjs - How Can I Mask My Material-UI TextField? -


i have textfield phone numbers in short form. , want mask form field (0)xxx xxx xx xx.

i'm trying use react-input-mask plugin material-ui. if want change input value, not updating main textfield.

        <textfield           ref="phone"           name="phone"           type="text"           value={this.state.phone}           onchange={this.onchange}         >           <inputmask value={this.state.phone} onchange={this.onchange} mask="(0)999 999 99 99" maskchar=" " />                     </textfield> 

actually, couldn't find documentation masking material-ui. i'm trying figure out how can use plugins.

this should trick:

<textfield   ref="phone"   name="phone"   type="text"   value={this.state.phone}   onchange={this.onchange} >   <inputmask mask="(0)999 999 99 99" maskchar=" " /> </textfield> 

demo:

edit yl8p9jvq9


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -