Opened 9 years ago

Closed 9 years ago

#7276 closed bug (notabug)

ui not being passed to autocomplete.open

Reported by: jostster Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.autocomplete Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:

Description

There is a similar bug that was closed for this as "worksforme" however I do not see it working as intended.

http://jsfiddle.net/UMGsJ/

the open ui variable should include the items that are being displayed in the ui-menu and not just the prototype object. For example if you click on an entry you will see the prototype object and the item logged to console from the 'display' page on the jsfiddle site. When the ui-menu open's only the prototype is displayed and not the items.

Change History (2)

comment:1 Changed 9 years ago by jostster

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

should probably be

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

To somewhat match the select which is _triggering the event and the selected item.

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

Resolution: invalid
Status: newclosed

The open event isn't supposed to contain any information. What you want is the response event which is being added in 1.9 (see #6777).

Note: See TracTickets for help on using tickets.