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

Fix binding of handleInputClick #676

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Fix binding of handleInputClick #676

merged 1 commit into from
Mar 11, 2024

Conversation

romaricpascal
Copy link
Member

Had missed that is was not bound like the other handleInput... functions when removing the wrapping arrow function in 25cc4a3.

This was displaying an error in the browser console as this was not defined when the method was called in response to clicks.

That error in the console seems the only effect of the function not being bound. Both with and without input, and with or without the autoselect option set, I did not notice any visual change in behaviour from the component.

We may want to review the purpose of that event handler, maybe the handleInputFocus one does enough? 🤔

Had missed that is was not bound like the other `handleInput...` functions
when removing the wrapping arrow function in 25cc4a3.

This was displaying an error in the browser console as `this` was not defined
when the method was called in response to clicks.

That error in the console seems the only effect of the function not being bound.
Both with and without input, and with or without the `autoselect` option set,
I did not notice any visual change in behaviour from the component.

We may want to review the purpose of that event handler, maybe the `handleInputFocus` one does enough? 🤔
@romaricpascal
Copy link
Member Author

Thinking we didn't catch it because we don't have anything failing tests when an error occurs inside the browser 😔 Opened #679 to track adding this as it doesn't seem straightforward.

@romaricpascal romaricpascal merged commit eabbb03 into main Mar 11, 2024
3 checks passed
@romaricpascal romaricpascal deleted the bind-input-click branch March 11, 2024 15:27
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