Skip to content

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