I am pretty new in this kind of collaboration, so I didn't know how to do it.
I had an issue when I use value to set a value from a fetch to fill the input. When I change the value, the mask's behavior was odd. After making some assumptions, I found that the best approach for this one, it was to use defaultValue to set the fetched value, and then when you change the value in the input, the behavior is pretty normal.
Hope this can help someone else, and maybe this is not the best way to ask for this change or maybe I should've opened a pull request after cloning the repo. If this information can be included in the documentation, would be great for newbies like me.
`<InputMask
name="myInput"
className={'form-control'}
autoFocus
{...setMyInputClass}
onChange={handleMyInputChange}
alwaysShowMask={true}
mask={--*****}
defaultValue={myInput} // using value instead defaultValue make an odd behavior
I am pretty new in this kind of collaboration, so I didn't know how to do it.
I had an issue when I use value to set a value from a fetch to fill the input. When I change the value, the mask's behavior was odd. After making some assumptions, I found that the best approach for this one, it was to use defaultValue to set the fetched value, and then when you change the value in the input, the behavior is pretty normal.
Hope this can help someone else, and maybe this is not the best way to ask for this change or maybe I should've opened a pull request after cloning the repo. If this information can be included in the documentation, would be great for newbies like me.
`<InputMask name="myInput" className={'form-control'} autoFocus {...setMyInputClass} onChange={handleMyInputChange} alwaysShowMask={true} mask={--*****} defaultValue={myInput} // using value instead defaultValue make an odd behavior