How to clear mask data when input is clear by the state?
See original GitHub issueI’m using the input mask that is connected with mobileNumber from component state. some time i need to clear the mobileNumber so i’m using the blow code. number is cleared and sate is updated but the mask first view ( stay in the input field i need to clear this when mobileNumber has empty string. See Here:https://ibb.co/ehWMod
const clearNum()=>{
this.setState({
mobileNumber:''
})
}
<TextInputMask
refInput={(ref) => this.myDateText = ref}
mask={"([000]) [000]-[0000]"}
placeholder="Mobile Phone"
placeholderTextColor={lightGrayColor}
underlineColorAndroid="transparent"
keyboardType="numeric"
style={homeStyles.PhoneInputText}
maxLength={15}
onChangeText={text => this.onTextChange(text)}
value={mobileNumber}
/>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:11
Top Results From Across the Web
How to clear mask data when input is clear by the state? #62
To use that branch, you simply use "react-native-text-input-mask": "git+https://github.com/derenebdon/react-native-text-input-mask.git#fixClear" ...
Read more >Clear (or change) input mask from input textbox (Using Jasny)
Essentially, store the cloned state in a variable, and use this variable to restore the element to it's original state before re-assigning the...
Read more >Control data entry formats with input masks - Microsoft Support
Learn how to add input masks in Access to table fields, queries, and to form and report controls to help people entering data....
Read more >Input Mask Guide | imaskjs
Range mask extends Pattern mask and can be used to restrict input in a number range. ... value: var rangeMask = IMask(element, {...
Read more >What's Data Masking? Types, Techniques & Best Practices
Take a backup or a golden copy of the production database to a different environment. Remove any unnecessary data, and mask it while...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m still having this issue as well
Hi @ivanzotov, do we have any updates on this? I have the same issue and need the fix for the project on which I’m working