From d6f6a324e0bc5b80d31435be59e714fd9b45d24f Mon Sep 17 00:00:00 2001 From: Beat Schwarzentrub Date: Wed, 16 Dec 2020 14:11:28 +0100 Subject: [PATCH] Fix up/down keys in multi line cell editors Don't propagate up/down key strokes to the table, because the table would call event.preventDefault() in its own "stop propagation interceptor" and the cursor would not move in multi line string fields. Change-Id: I4b8db89aae8da120e239f92a45cfa06f457bf7b1 Reviewed-on: https://git.eclipse.org/r/c/scout/org.eclipse.scout.rt/+/173857 Tested-by: Scout Bot Reviewed-by: Beat Schwarzentrub --- .../src/main/js/scout/table/editor/CellEditorPopup.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/table/editor/CellEditorPopup.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/table/editor/CellEditorPopup.js index 73ba7f07cd3..e9cb69297bc 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/table/editor/CellEditorPopup.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/table/editor/CellEditorPopup.js @@ -41,6 +41,15 @@ scout.CellEditorPopup.prototype._initKeyStrokeContext = function() { new scout.CellEditorCompleteEditKeyStroke(this), new scout.CellEditorTabKeyStroke(this) ]); + + // Don't propagate up/down key strokes to the table, because the table + // would call event.preventDefault() in its own "stop propagation + // interceptor" and the cursor would not move in multi line string fields. + this.keyStrokeContext.registerStopPropagationInterceptor(function(event) { + if (scout.isOneOf(event.which, scout.keys.UP, scout.keys.DOWN)) { + event.stopPropagation(); + } + }); }; /**