Skip to content

Commit eaadcc0

Browse files
committed
Widget: Bind the remove event to the element, not the .widget() element.
1 parent 5f9d5c5 commit eaadcc0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $.widget( "ui.autocomplete", {
6464
.addClass( "ui-autocomplete-input" )
6565
.attr( "autocomplete", "off" );
6666

67-
this._on({
67+
this._on( this.element, {
6868
keydown: function( event ) {
6969
if ( this.element.prop( "readOnly" ) ) {
7070
suppressKeyPress = true;
@@ -191,6 +191,7 @@ $.widget( "ui.autocomplete", {
191191
.zIndex( this.element.zIndex() + 1 )
192192
.hide()
193193
.data( "menu" );
194+
194195
this._on( this.menu.element, {
195196
mousedown: function( event ) {
196197
// prevent moving focus out of the text field

ui/jquery.ui.widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ $.Widget.prototype = {
237237
// TODO remove dual storage
238238
$.data( element, this.widgetName, this );
239239
$.data( element, this.widgetFullName, this );
240-
this._on({
240+
this._on( this.element, {
241241
remove: function( event ) {
242242
if ( event.target === element ) {
243243
this.destroy();

0 commit comments

Comments
 (0)