Skip to content

Commit

Permalink
Fix up/down keys in multi line cell editors
Browse files Browse the repository at this point in the history
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 <scout-bot@eclipse.org>
Reviewed-by: Beat Schwarzentrub <bsh@bsiag.com>
  • Loading branch information
bschwarzent committed Jan 11, 2021
1 parent afec739 commit d6f6a32
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
};

/**
Expand Down

0 comments on commit d6f6a32

Please sign in to comment.