Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#6752 closed bug (fixed)

Menu may still render when autocomplete is disabled

Reported by: draenor Owned by:
Priority: minor Milestone: 1.8.8
Component: ui.autocomplete Version: 1.8.7
Keywords: Cc:
Blocked by: Blocking:

Description

When the autocomplete plugin is disabled with outstanding ajax requests, the menu will still render when the request returns.

Proposed fix: Add !this.options.disabled to if statement in _response.

E.g.,

_response: function( content ) {

if ( !this.options.disabled && content && content.length ) {

content = this._normalize( content ); this._suggest( content ); this._trigger( "open" );

} else {

this.close();

} this.element.removeClass( "ui-autocomplete-loading" );

}

Change History (5)

comment:1 Changed 12 years ago by draenor

When the autocomplete plugin is disabled with outstanding ajax requests, the menu will still render when the request returns.

Proposed fix:

Add !this.options.disabled to if statement in _response.

E.g.,

_response: function( content ) {
    if ( !this.options.disabled && content && content.length ) {
        content = this._normalize( content ); 
        this._suggest( content ); 
        this._trigger( "open" );
    } else {
        this.close();
    } this.element.removeClass( "ui-autocomplete-loading" );
}

This flaw becomes very apparent when constructing completely ajax-driven pages where the autocomplete plugin may need to be forsibly closed every time e.g., a button is pressed.

comment:2 Changed 12 years ago by Scott González

Status: newopen

comment:3 Changed 12 years ago by Scott González

Resolution: fixed
Status: openclosed

Autocomplete: Abort pending ajax requests when disabled and prevent handling results when disabled. Fixes #6752 - Menu may still render when autocomplete is disabled.

Changeset: 0d0c86210c4a6473888089ddcea918df8c156022

comment:4 Changed 12 years ago by Scott González

Autocomplete: Abort pending ajax requests when disabled and prevent handling results when disabled. Fixes #6752 - Menu may still render when autocomplete is disabled.

Changeset: d2a12ff825ebb0e620b25abdbcbaf024881ef537

comment:5 Changed 12 years ago by Scott González

Milestone: 1.91.8.8
Note: See TracTickets for help on using tickets.