Skip to content

Feature/forward arrow key autocomplete - #81

Merged
vikasrohit merged 4 commits into
devfrom
feature/forward-arrow-key-autocomplete
Apr 14, 2016
Merged

Feature/forward arrow key autocomplete#81
vikasrohit merged 4 commits into
devfrom
feature/forward-arrow-key-autocomplete

Conversation

@vikasrohit

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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