Skip to content

Commit a63d23c

Browse files
committed
Autocomplete: Added unit test to check for preventing value change when an unintended mouseover event (Firefox) is fired before blur. Proposed fix is in pull request 236
1 parent ce6209b commit a63d23c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/unit/autocomplete/autocomplete_events.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,20 @@ test("cancel select", function() {
203203
}, 50);
204204
});
205205

206+
test("blur without selection", function() {
207+
expect(1);
208+
var ac = $("#autocomplete").autocomplete({
209+
delay: 0,
210+
source: data
211+
});
212+
stop();
213+
ac.val("j").keydown();
214+
setTimeout(function() {
215+
$( ".ui-menu-item" ).first().simulate("mouseover");
216+
ac.simulate("keydown", { keyCode: $.ui.keyCode.TAB });
217+
same( ac.val(), "j" );
218+
start();
219+
}, 50);
220+
});
221+
206222
})(jQuery);

0 commit comments

Comments
 (0)