aria-autocomplete と twitter/bloodhound typeahead を実装しました。
問題:値を取得するという意味で部分的に機能していますが、自動的に選択されるようにしたいです。メンバー ID を入力すると、下の div と非表示のテキスト ボックス (ユーザーが次の画面に移動できるようにする前に、後で値があるかどうかがチェックされます) で名前が自動的に選択されます。
私が試したこと: 私は以下を読みました:
https://msdn.microsoft.com/en-us/ie/hh968240(v=vs.94) https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/ listbox-combo.html
次に、「aria-autocomplete」:「list」を「both」と「inline」に変更しましたが、どちらも影響しませんでした。
次に、テキストボックスをオートコンプリート オフからオートコンプリート オンに変更しましたが、効果はありません。
次に、タイプアヘッドについて読みましたが、オートコンプリートが影響を与えない理由がわかりません。そのためのコードは次のとおりです。
.
displayKey: function (item) { return item.Subscriber_ID },
templates: {
//Template to show if there are no results
empty: function (context) {
// console.log(1) // put here your code when result not found
$(".tt-dataset").text('No Results Found');
},
suggestion: function (item) {
return '<div class=""> ' + item.First_Name + " " + item.Last_Name + '</div>';
}
}
})
.