Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'start' of null #141

Closed
richardvaldiviesomacias opened this issue May 29, 2018 · 10 comments
Closed

Cannot read property 'start' of null #141

richardvaldiviesomacias opened this issue May 29, 2018 · 10 comments

Comments

@richardvaldiviesomacias
Copy link

richardvaldiviesomacias commented May 29, 2018

We are using the version 1.2.2 and we tried to upgrade to the latest version. We got the following error: Cannot read property 'start' of null. Could you please help us?

<InputMask type="tel" className="" autoComplete="tel-national" placeholder="(555) 555-0199" mask="(999) 999-9999" value= onBlur= onChange=/>

@sanniassin
Copy link
Owner

Could you provide a demo repo with reproducible error?

@crstamps2
Copy link

crstamps2 commented Jun 11, 2018

I have this problem as well. Using Enzyme to simulate an onChange event causes this error to throw. I will try and get a demo repo up for you.

react-input-mask: 2.0.1
enzyme: 3.3.0

@sanniassin
Copy link
Owner

sanniassin commented Jun 12, 2018

It must be due to firing onChange on Input without focus. Have an idea how to fix it, but it's better to see a demo first.

Could you also try to set a focus on input and check if error is gone?

@crstamps2
Copy link

crstamps2 commented Jun 12, 2018

@sanniassin
Copy link
Owner

Fixed in 2.0.2

@crstamps2
Copy link

While that issue was resolved, upgrading the package caused a new issue.

https://travis-ci.com/crstamps2/react-input-mask-enzyme/builds/76073960

@sanniassin
Copy link
Owner

https://github.com/crstamps2/react-input-mask-enzyme/blob/master/src/App.js#L10

It happens because of the undefined this.searchTerm. I suppose it must be this.phone_number.length instead.

@crstamps2
Copy link

crstamps2 commented Jun 12, 2018

You're right. My bad. All is good with this then! Thanks for the quick responses!

@vgjenks
Copy link

vgjenks commented Mar 11, 2022

Fixed in 2.0.2

I'm using 2.0.4 and I get this error every time - even if I force a value into the field. There's just no explanation for it.

image

@RicoyPagoaga
Copy link

lo solucione quitando el onFocus del input que utilizaba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants