aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-04-20 14:13:09 +0200
committerMario Vavti <mario@mariovavti.com>2016-04-20 14:13:09 +0200
commit8147e6203f863d27c6e479cd096b71a940c4f58e (patch)
treeeb7617b0223a5498e28a83882c4e89151202c6c5 /view/js
parent683da1aa7748971aad328c9b658e5e6308b7f270 (diff)
downloadvolse-hubzilla-8147e6203f863d27c6e479cd096b71a940c4f58e.tar.gz
volse-hubzilla-8147e6203f863d27c6e479cd096b71a940c4f58e.tar.bz2
volse-hubzilla-8147e6203f863d27c6e479cd096b71a940c4f58e.zip
Use stopImmidiatePropagation() only if we are in a list to not interfere with other keypress listeners (e.g. chat).
Diffstat (limited to 'view/js')
-rw-r--r--view/js/autocomplete.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 59e3600b3..84cc075dc 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -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();
+ }
}
});
};