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 73ed738
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@kborchers
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.