Skip to content

Commit a92615d

Browse files
author
vikasrohit
committed
AS#111383418066580, Autocomplete the search text on forward arrow key
-- Added desired behaviour
1 parent 2777646 commit a92615d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/SearchBar/SearchBar.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ class SearchBar extends Component {
9898
this.setState({ searchState: 'filled' }, function() {
9999
this.search()
100100
})
101+
} else if (eventKey === 39) { // right arrow key is pressed
102+
const suggestion = this.state.suggestions[0]
103+
this.refs.searchValue.value = suggestion
104+
// trigger the change event handler
105+
this.onChange()
101106
}
102107
}
103108

0 commit comments

Comments
 (0)