Skip to content

Commit fbc38cb

Browse files
committed
fix(edit): tweak the deep edit keydown logic so that Enter and Tab stops editing
1 parent 9dfe9fd commit fbc38cb

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/features/edit/js/gridEdit.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -881,15 +881,12 @@
881881
break;
882882
}
883883

884-
if ($scope.deepEdit) {
885-
switch (evt.keyCode) {
886-
case uiGridConstants.keymap.LEFT:
887-
case uiGridConstants.keymap.RIGHT:
888-
case uiGridConstants.keymap.UP:
889-
case uiGridConstants.keymap.DOWN:
890-
evt.stopPropagation();
891-
break;
892-
}
884+
if ($scope.deepEdit &&
885+
evt.keyCode === uiGridConstants.keymap.LEFT ||
886+
evt.keyCode === uiGridConstants.keymap.RIGHT ||
887+
evt.keyCode === uiGridConstants.keymap.UP ||
888+
evt.keyCode === uiGridConstants.keymap.DOWN) {
889+
evt.stopPropagation();
893890
}
894891
// Pass the keydown event off to the cellNav service, if it exists
895892
else if (uiGridCtrl && uiGridCtrl.grid.api.cellNav) {

0 commit comments

Comments
 (0)