corejavascript/typeahead.js
在 GitHub 查看autocomplete() should trigger autocomplete event even when text already matches
Open
#132 建立於 2017年3月15日
enhancementhelp wanted
倉庫指標
- Star
- (956 star)
- PR 合併指標
- (30 天內沒有已合併 PR)
描述
Currently, autocomplete() doesn't trigger the autocomplete event if the input text matches the given $selectable. Why should it, if autocompletion won't change the text?
Because there may be other data attached to the typeahead choice which is extracted by downstream logic listening for the event.
Instead of
isValid = data && query !== data.val;
if (isValid && !this.eventBus.before('autocomplete', data.obj, data.dataset)) {
it should be just
if (data && !this.eventBus.before('autocomplete', data.obj, data.dataset)) {