Skip to content
Permalink
Browse files

Autocomplete: Added check to determine if menu has just been created …

…to override mouseover event and reset that variable from autocomplete on close. Fixed #7024 - Autocomplete menu options are activated even if mouse is not moved
  • Loading branch information...
kborchers committed May 9, 2011
1 parent af5b5b1 commit 73ed73890c0e91430a6dc2a01a971f9a4586a6e0
Showing with 4 additions and 1 deletion.
  1. +1 −0 ui/jquery.ui.autocomplete.js
  2. +3 −1 ui/jquery.ui.menu.js
@@ -338,6 +338,7 @@ $.widget( "ui.autocomplete", {
this.menu.element.hide();
this.menu.blur();
this._trigger( "close", event );
this.menu.isNewMenu = true;
}
},

@@ -18,6 +18,7 @@ var idIncrement = 0;
$.widget("ui.menu", {
defaultElement: "<ul>",
delay: 150,
isNewMenu: true,
options: {
position: {
my: "left top",
@@ -54,7 +55,8 @@ $.widget("ui.menu", {
self.select( event );
})
.bind( "mouseover.menu", function( event ) {
if ( self.options.disabled ) {
if ( self.options.disabled || self.isNewMenu ) {
self.isNewMenu = false;
return;
}
var target = $( event.target ).closest( ".ui-menu-item" );

2 comments on commit 73ed738

@jzaefferer

This comment has been minimized.

Copy link
Member

replied May 15, 2011

I reopened #7024 after reverting this change: http://bugs.jqueryui.com/ticket/7024#comment:6

@kborchers

This comment has been minimized.

Copy link
Member Author

replied May 15, 2011

I have modified that solution so that isNewMenu is only set to true via autocomplete. That should fix any issues the previous commit caused to menu. I submitted a new pull here #280.

Thanks,
Kris

Please sign in to comment.
You can’t perform that action at this time.