🌐 AI搜索 & 代理 主页
Skip to content

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.

2 participants