From 97fd0f1e2948c6b38369aef3a6051e8c82c3bc73 Mon Sep 17 00:00:00 2001 From: Colby Sargent Date: Thu, 13 Apr 2017 17:01:37 +0100 Subject: [PATCH 1/2] allowMismatch bug fix Line 315: Change setValue.val(""); to setValue(""); This will now set original select's value to blank as intended. Previously this would have no effect and instead kept previously selected values. Fixes issues #13 and #37. --- jquery.flexselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.flexselect.js b/jquery.flexselect.js index 6f8105b..272f206 100644 --- a/jquery.flexselect.js +++ b/jquery.flexselect.js @@ -312,7 +312,7 @@ this.setValue(selected.value); this.picked = true; } else if (this.settings.allowMismatch) { - this.setValue.val(""); + this.setValue(""); } else { this.reset(); } From cf6951c6dff26d00b85c95def3a4a4d2d9ec7ced Mon Sep 17 00:00:00 2001 From: Colby Sargent Date: Thu, 13 Apr 2017 17:08:32 +0100 Subject: [PATCH 2/2] Show results if a blank option is selected Line 108: Show results if picked option is blank. --- jquery.flexselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.flexselect.js b/jquery.flexselect.js index 6f8105b..722c479 100644 --- a/jquery.flexselect.js +++ b/jquery.flexselect.js @@ -105,7 +105,7 @@ this.input.focus(function() { self.abbreviationBeforeFocus = self.input.val(); self.input[0].setSelectionRange(0, self.input.val().length); - if (!self.picked) self.filterResults(); + if (!self.picked || self.input.val() == '') self.filterResults(); }); this.input.blur(function() {