Skip to content

Commit

Permalink
Fix binding of handleInputClick
Browse files Browse the repository at this point in the history
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? 🤔
  • Loading branch information
romaricpascal committed Mar 1, 2024
1 parent 26a7839 commit 2360f46
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/accessible-autocomplete.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/accessible-autocomplete.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.preact.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.preact.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.react.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.react.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default class Autocomplete extends Component {

this.handleInputBlur = this.handleInputBlur.bind(this)
this.handleInputChange = this.handleInputChange.bind(this)
this.handleInputClick = this.handleInputClick.bind(this)
this.handleInputFocus = this.handleInputFocus.bind(this)

this.pollInputElement = this.pollInputElement.bind(this)
Expand Down

0 comments on commit 2360f46

Please sign in to comment.