Skip to content

Feature/forward arrow key autocomplete #81

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

Merged
merged 4 commits into from
Apr 14, 2016

Conversation

vikasrohit
Copy link

AS#111383418066580, Autocomplete the search text on forward arrow key
AS#111383418066583, Support arrow navigation for moving between suggested terms in SearchBar

@nlitwin @parthshah fyi

vikasrohit added 4 commits April 12, 2016 18:04
-- Handled case where there was no search suggestion
…sted terms in SearchBar

-- Added up down arrow key behaviour. Need to do some more testing and cleanup
…sted terms in SearchBar

-- Fixed lint errors
@vikasrohit
Copy link
Author

@nlitwin Please let me know what do you think about the two features added through this PR and any code improvement that I can make.

@vikasrohit
Copy link
Author

Merging for now, but happy to do any change required to improve the feature or the code. You can see the live changes on any legacy page of topcoder-dev.com.

@vikasrohit vikasrohit merged commit eeab780 into dev Apr 14, 2016
// if return is pressed
if (eventKey === 13) {
this.setState({ searchState: 'filled' }, function() {
this.search()
})
} else if (eventKey === 39) { // right arrow key is pressed
const suggestion = this.state.suggestions.length > 0 ? this.state.suggestions[0] : null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think const suggestion = this.state.suggestions[0] would work too

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess yes because that would assign undefined if suggestions array does not have any element in it and if (suggestion) would not evaluate to true in both cases, undefined and null

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to close the thread, change is done in dev.

@vikasrohit vikasrohit deleted the feature/forward-arrow-key-autocomplete branch October 24, 2017 09:57
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