-
Notifications
You must be signed in to change notification settings - Fork 217
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
(Breaking change in 1.7.32) AsYouType().input(null) no longer works #383
Comments
AsYouType().input() expects a string not null
you can't search null as null is not typeof string. |
@nshCore is correct. Closing. |
There has been another issue about this change, so I'll reopen this issue so that others could see it. Added a note in the changelog. The relevant change seems to be this big refactoring of |
May I know why you don't handle text like below?
I think the adding of extractFormattedPhoneNumber function is not a patch level change. |
I did agree that it does break some code. |
I agree with @tamonmon0417 about this being more than a patch level change. Ran into this bug today after upgrading from 1.7.28 -> 1.7.48. If a value is null or undefined, a sanity check is necessary now. |
Yes, this results in an extra |
Commenting on the previous comment, the better way would be creating a custom "helper" function in an app, something like |
@catamphetamine I agree that it's entirely up to you to decide the types your library's function's will accept/handle, and that it makes no sense to attempt to format a null value. I think the only issue anyone would have is the fact that this is a case of subtracting functionality (ie. introducing breaking changes) in a patch. It's an easy enough fix on my end, but I'm sure there will be more people running into this as they upgrade. |
@jbberinger Yes, this is certainly violating the SemVer spec ) |
Steps to reproduce
return AsYouType().input(null)
Observed result
TypeError: Cannot read property 'search' of null
Expected result
return null
The text was updated successfully, but these errors were encountered: