Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #280

Closed
wants to merge 1 commit into from
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 15, 2011
commit d77d01c0e91fd2a10e9848618a307796381d4f86
2 changes: 2 additions & 0 deletions ui/jquery.ui.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ $.widget( "ui.autocomplete", {
})
.menu({
// custom key handling for now
isNewMenu: true,
input: $(),
focus: function( event, ui ) {
var item = ui.item.data( "item.autocomplete" );
Expand Down Expand Up @@ -362,6 +363,7 @@ $.widget( "ui.autocomplete", {
close: function( event ) {
clearTimeout( this.closing );
if ( this.menu.element.is(":visible") ) {
this.menu.element.menu( "option", "isNewMenu", true );
this.menu.element.hide();
this.menu.blur();
this._trigger( "close", event );
Expand Down
6 changes: 4 additions & 2 deletions ui/jquery.ui.menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ $.widget("ui.menu", {
position: {
my: "left top",
at: "right top"
}
},
isNewMenu: false
},
_create: function() {
var self = this;
Expand Down Expand Up @@ -52,7 +53,8 @@ $.widget("ui.menu", {
self.select( event );
})
.bind( "mouseover.menu", function( event ) {
if ( self.options.disabled ) {
if ( self.options.disabled || self.options.isNewMenu ) {
self.options.isNewMenu = false;
return;
}
var target = $( event.target ).closest( ".ui-menu-item" );
Expand Down