From 8cda4e2d6a45f4be0def17cf8f012f78e61fb026 Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Wed, 28 Jun 2017 10:07:37 +0200 Subject: [PATCH] Use updater function when next or prev key press for update input text value --- bootstrap3-typeahead.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap3-typeahead.js b/bootstrap3-typeahead.js index bb8b535..3aab446 100644 --- a/bootstrap3-typeahead.js +++ b/bootstrap3-typeahead.js @@ -341,7 +341,8 @@ next.addClass('active'); // added for screen reader - this.$element.val(next.text()); + var newVal = this.updater(next.data('value')); + this.$element.val(this.displayText(newVal) || newVal); }, prev: function (event) { @@ -354,7 +355,8 @@ prev.addClass('active'); // added for screen reader - this.$element.val(prev.text()); + var newVal = this.updater(next.data('value')); + this.$element.val(this.displayText(newVal) || newVal); }, listen: function () {