Skip to content

Commit

Permalink
Fix ajax and live issues
Browse files Browse the repository at this point in the history
I ran into an issue where the input is cleared immediately when typing if live = true. Changing live to false fixed the issue. But I needed to patch the _selectChoice function otherwise the items array is outdated when selecting.
  • Loading branch information
patrickgalbraith committed Aug 25, 2014
1 parent f3c9f8c commit 42ad48c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jquery.minimalect.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
}

// poll the original for changes
if(op.live){
if(op.live && !op.ajax){
// set cache to the original value
var prevval = this.element.val();
// set a tight interval to check for the original
Expand Down Expand Up @@ -546,6 +546,9 @@

// if it's disabled, au revoir
if(ch.hasClass(this.options.class_disabled)) return false;

if(!op.live)
this.items = this.wrapper.find('li');

// apply the selected class
if(!this.element.prop("multiple"))
Expand Down

0 comments on commit 42ad48c

Please sign in to comment.