Browse Source

Improved UX of user selection

Supported Tab for selecting highlighted item
Selecting first item by Tab, if nothing is highlighted

Closes #774
master
Igor Zhukov 9 years ago
parent
commit
22fb8097b4
  1. 5
      app/js/message_composer.js

5
app/js/message_composer.js

@ -586,8 +586,11 @@ MessageComposer.prototype.onKeyEvent = function (e) { @@ -586,8 +586,11 @@ MessageComposer.prototype.onKeyEvent = function (e) {
return cancelEvent(e);
}
if (e.keyCode == 13) { // ENTER
if (e.keyCode == 13 || e.keyCode == 9) { // Enter or Tab
var currentSelected = $(this.autoCompleteEl).find('.composer_autocomplete_option_active');
if (!currentSelected.length && e.keyCode == 9) {
currentSelected = $(this.autoCompleteEl[0].childNodes[0]).find('a');
}
var code, mention;
if (code = currentSelected.attr('data-code')) {
this.onEmojiSelected(code, true);

Loading…
Cancel
Save