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

This commit is contained in:
rabuzarus 2016-04-29 14:42:12 +02:00 committed by Roland Haeder
parent 31a30fc310
commit 95643c1ca2
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78

View file

@ -163,6 +163,9 @@ function listNewLineAutocomplete(id) {
setCaretPosition(text, caretPos + 5);
return true;
}
else {
return false;
}
}
function string2bb(element) {
@ -325,12 +328,13 @@ 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();
}
}
});
};
})( jQuery );