Skip to content

Commit

Permalink
Reset suggestionsContainer scrollTop to 0 when input onChange event h…
Browse files Browse the repository at this point in the history
…appened (moroshko#365)
  • Loading branch information
muz3 authored and stephyeung committed Jan 25, 2021
1 parent 2756946 commit b6228d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Autosuggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ export default class Autosuggest extends Component {

this.maybeCallOnChange(event, value, 'type');

if (this.suggestionsContainer) {
this.suggestionsContainer.scrollTop = 0;
}

this.setState({
...(highlightFirstSuggestion
? {}
Expand Down

0 comments on commit b6228d5

Please sign in to comment.