From 3347f2414b0668e1899e4336220bf159a5bde03a Mon Sep 17 00:00:00 2001 From: railsonrdr Date: Wed, 28 Jun 2017 09:13:55 -0300 Subject: [PATCH 1/2] On blur field with click autoSelect On blur field with click if autoSelect is true the first element is selected. This is ocured only tab before. --- bootstrap3-typeahead.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap3-typeahead.js b/bootstrap3-typeahead.js index bb8b535..d8d9151 100644 --- a/bootstrap3-typeahead.js +++ b/bootstrap3-typeahead.js @@ -502,6 +502,7 @@ blur: function (e) { if (!this.mousedover && !this.mouseddown && this.shown) { + this.select(); this.hide(); this.focused = false; this.keyPressed = false; From bcb9daab605cd2202c4a803236ae4def1882bf96 Mon Sep 17 00:00:00 2001 From: railsonrdr Date: Wed, 28 Jun 2017 09:48:47 -0300 Subject: [PATCH 2/2] Update bootstrap3-typeahead.js --- bootstrap3-typeahead.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap3-typeahead.js b/bootstrap3-typeahead.js index d8d9151..d4e6ef6 100644 --- a/bootstrap3-typeahead.js +++ b/bootstrap3-typeahead.js @@ -159,7 +159,7 @@ if (typeof(query) != 'undefined' && query !== null) { this.query = query; } else { - this.query = this.$element.val() || this.$element.text() || ''; + this.query = this.$element.val(); } if (this.query.length < this.options.minLength && !this.options.showHintOnFocus) {