Skip to content

Commit cf9c75f

Browse files
committed
plugin only, docs
1 parent 468f3a6 commit cf9c75f

File tree

2 files changed

+4
-168
lines changed

2 files changed

+4
-168
lines changed

js/jquery.relevant-dropdown.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
// Fill new fake datalist
4343
datalistItems.each(function() {
4444
$("<li />", {
45-
"text": $(this).val()
45+
// .val is required here, not .text or .html
46+
// HTML *needs* to be <option value="xxx"> not <option>xxx</option> (IE)
47+
"text": $(this).val()
4648
}).appendTo($datalist);
4749
});
4850

@@ -57,7 +59,6 @@
5759
scrollValue = 0;
5860
})
5961
.on("blur", function() {
60-
6162
// If this fires immediately, it prevents click-to-select from working
6263
setTimeout(function() {
6364
$datalist.fadeOut(options.fadeOutSpeed);
@@ -66,7 +67,6 @@
6667
})
6768
.on("keyup focus", function(e) {
6869
searchPosition = $input.position();
69-
7070
// Build datalist
7171
$datalist
7272
.show()
@@ -144,7 +144,7 @@
144144
}
145145

146146
// return or tab key
147-
if ( e.keyCode == 13 || e.keyCode == 9 ) {
147+
if ( e.keyCode == 13 || e.keyCode == 9 ){
148148
if (active.length) {
149149
$input.val(active.text());
150150
item_selected(active.text());

js/relevant-dropdown.js

Lines changed: 0 additions & 164 deletions
This file was deleted.

0 commit comments

Comments
 (0)