Skip to content
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

on up/down arrow, set the input only if data.val is a string #184

Merged
merged 1 commit into from
Nov 16, 2019

Conversation

kielni
Copy link
Contributor

@kielni kielni commented May 7, 2018

Enter search text, then click a down arrow; it sets the value of the input:

https://github.com/corejavascript/typeahead.js/blob/master/src/typeahead/typeahead.js#L416

    // cursor moved to different selectable
    if (data) {
      this.input.setInputValue(data.val);
    }

but if the dataset contains objects, this will set the input to [object Object]:

screen shot 2018-05-07 at 6 40 14 am

Arrows should only navigate through suggestions; clicking an arrow should not redo the search for just the highlighted suggestion. This change skips setting the input value if data is not a string.

screen shot 2018-05-07 at 6 37 48 am

don't want to set it to [Object object] or redo search
@jlbooker
Copy link
Contributor

Thanks @kielni !

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.

None yet

2 participants