Skip to content

Commit

Permalink
clear previous and term after changing source
Browse files Browse the repository at this point in the history
`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;
  • Loading branch information
safareli committed May 27, 2014
1 parent 796a8b3 commit ba1e4fa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/autocomplete.js
Expand Up @@ -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() );
Expand Down

0 comments on commit ba1e4fa

Please sign in to comment.