Use stopImmidiatePropagation() only if we are in a list to not interfere with other keypress listeners (e.g. chat).

This commit is contained in:
Mario Vavti 2016-04-20 14:13:09 +02:00
parent 683da1aa77
commit 8147e6203f

View File

@ -147,6 +147,9 @@ function listNewLineAutocomplete(id) {
setCaretPosition(text, caretPos + 5);
return true;
}
else {
return false;
}
}
function string2bb(element) {
@ -315,11 +318,12 @@ function string2bb(element) {
a.on('textComplete:select', function(e, value, strategy) { value; });
a.keypress(function(e){
e.stopImmediatePropagation();
if (e.keyCode == 13) {
var x = listNewLineAutocomplete(this.id);
if(x)
if(x) {
e.stopImmediatePropagation();
e.preventDefault();
}
}
});
};