From ba1e4fa94347e3e9bfc32fbfe0213acb4af909ac Mon Sep 17 00:00:00 2001 From: Irakli Safareli Date: Tue, 27 May 2014 05:27:58 -0700 Subject: [PATCH] clear `previous` and `term` after changing source `previous` and `term` should be cleared after changing source data. reason: user enters 'a' in input and autocomplete displays pup up; inputs data source is changed; inputs value is cleared by $element.val(''); user enters 'a' again and autocomplete doesn't displays pup up because `term` is not cleared; --- ui/autocomplete.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/autocomplete.js b/ui/autocomplete.js index d53a1d5e355..691b42d54e2 100644 --- a/ui/autocomplete.js +++ b/ui/autocomplete.js @@ -331,6 +331,8 @@ $.widget( "ui.autocomplete", { this._super( key, value ); if ( key === "source" ) { this._initSource(); + this.term = ''; + this.previous = ''; } if ( key === "appendTo" ) { this.menu.element.appendTo( this._appendTo() );