Open rkrz opened 12 years ago
Ok I found the issue. For whatever reason when a key is pressed firefox reports a 'keydown' and a 'keypress' event at the same time. Therefore one keypress leads to virtual to keypresses resulting in skipping every second search result.
To fix that the listen function was modified to:
listen: function () {
this.$element.on('blur', $.proxy(this.blur, this))
.on('keyup', $.proxy(this.keyup, this));
if (this.eventSupported('keydown')) {
this.$element.on('keydown', $.proxy(this.keypress, this));
} else {
this.$element.on('keypress', $.proxy(this.keypress, this))
}
this.$menu.on('click', $.proxy(this.click, this))
.on('mouseenter', 'li', $.proxy(this.mouseenter, this));
}
I'm viewing the 'Twitter Bootstrap Typeahead Extension Demo' v1.2.2 form my local file system. In Firefox 14.0.1 and Opera 12.00 it is only possible to select every second entry of the search results in the dropdown. In detail:
In Chrome it works as expected.