Permalink
Browse files

Autocomplete: Added unit test to check for preventing value change wh…

…en an unintended mouseover event (Firefox) is fired before blur. Proposed fix is in pull request 236
  • Loading branch information...
kborchers committed May 10, 2011
1 parent ce6209b commit a63d23c3145a88386b8274e3929630b2416d7f87
Showing with 16 additions and 0 deletions.
  1. +16 −0 tests/unit/autocomplete/autocomplete_events.js
@@ -203,4 +203,20 @@ test("cancel select", function() {
}, 50);
});
+test("blur without selection", function() {
+ expect(1);
+ var ac = $("#autocomplete").autocomplete({
+ delay: 0,
+ source: data
+ });
+ stop();
+ ac.val("j").keydown();
+ setTimeout(function() {
+ $( ".ui-menu-item" ).first().simulate("mouseover");
+ ac.simulate("keydown", { keyCode: $.ui.keyCode.TAB });
+ same( ac.val(), "j" );
+ start();
+ }, 50);
+});
+
})(jQuery);

0 comments on commit a63d23c

Please sign in to comment.