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

Add optional chaining operator #106

Merged
merged 1 commit into from
Jan 6, 2024
Merged

Add optional chaining operator #106

merged 1 commit into from
Jan 6, 2024

Conversation

joshsj89
Copy link
Contributor

@joshsj89 joshsj89 commented Jan 6, 2024

While using the library, I ran into an issue. If I pressed the back button of my app or the hardware back button while the dropdown was still open, the dropdown would disappear, but it would still be there as the blur never technically "closed." So if you tapped the places where the dropdown was before disappearing, an error would be thrown saying "TypeError: Cannot read property 'blur' of null". So, I added an optional chaining operator (?.) to the place where .blur() was called just to make sure that inputRef.current isn't null. This fixed the issue!

@onmotion onmotion merged commit ba8f152 into onmotion:main Jan 6, 2024
@onmotion
Copy link
Owner

onmotion commented Jan 6, 2024

Thanks @joshsj89, v3.1.3 has been published

@joshsj89 joshsj89 deleted the blur-on-back-button branch January 6, 2024 17:58
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

Successfully merging this pull request may close these issues.

2 participants