Skip to content

Commit

Permalink
Merge pull request #295 from wincelau/textnextprev
Browse files Browse the repository at this point in the history
Use updater function when next or prev key press for update input text value
  • Loading branch information
bassjobsen authored Oct 5, 2017
2 parents 27e3941 + 8cda4e2 commit d7b18ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bootstrap3-typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,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) {
Expand All @@ -355,7 +356,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 () {
Expand Down

0 comments on commit d7b18ad

Please sign in to comment.