question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to clear mask data when input is clear by the state?

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:11

github_iconTop GitHub Comments

3reactions
lunatupinicommented, Jul 24, 2019

I’m still having this issue as well

2reactions
ionhcommented, Jan 14, 2019

@dharamEnest thank you for the issue. I’ve tried to reproduce and saw the bug, will review the PR of @artyorsh and hope merge that.

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found