Skip to content

Go to the first suggestion in the search field on Enter [#1149] #1307

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 1 commit into from
Dec 27, 2016

Conversation

astashov
Copy link
Contributor

Unfortunately, typeahead.js doesn't give us any API for fetching current
suggesions, so we workaround that by adding href of a suggesion into
a data attribute of HTML for that suggestion, and then fetching
suggestions from DOM, choosing the first one, and using it's
data-href. Quite dirty though :( I'd prefer to do something like
typeAheadElement.typeadead('suggestions')[0].href instead.

Testing: Checked that functionality in latest Chrome, Firefox and Safari

Fixes #1149

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Dec 26, 2016
Unfortunately, typeahead.js doesn't give us any API for fetching current
suggesions, so we workaround that by adding `href` of a suggesion into
a data attribute of HTML for that suggestion, and then fetching
suggestions from DOM, choosing the first one, and using it's
`data-href`. Quite dirty though :( I'd prefer to do something like
`typeAheadElement.typeadead('suggestions')[0].href` instead.

Testing: Checked that functionality in latest Chrome, Firefox and Safari

Fixes dart-lang#1149
@astashov astashov force-pushed the improve-ui-of-search-field branch from 7e0ae1e to c236ca0 Compare December 27, 2016 05:09
@devoncarew
Copy link
Member

lgtm

@devoncarew devoncarew merged commit 08da7d6 into dart-lang:master Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants