From f3a45ef51e5f49c11490654cb757b579163e45ba Mon Sep 17 00:00:00 2001 From: c0bra Date: Thu, 13 Nov 2014 10:56:36 -0600 Subject: [PATCH] fix(Edit): Retain "focus" in endEdit() When hitting the ESC key in a cell while editing it, the cell was losing focus when it should have been retained. This fix accounts for the changes to using actual CSS classes instead of relying on :focus. --- src/features/edit/js/gridEdit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/edit/js/gridEdit.js b/src/features/edit/js/gridEdit.js index 6130bddfc1..458debffbb 100644 --- a/src/features/edit/js/gridEdit.js +++ b/src/features/edit/js/gridEdit.js @@ -557,7 +557,7 @@ $elm.append(cellElement); $compile(cellElement)($scope.$new()); var gridCellContentsEl = angular.element($elm.children()[0]); - isFocusedBeforeEdit = gridCellContentsEl.hasClass(':focus'); + isFocusedBeforeEdit = gridCellContentsEl.hasClass('ui-grid-cell-focus'); gridCellContentsEl.addClass('ui-grid-cell-contents-hidden'); }); @@ -594,7 +594,7 @@ angular.element($elm.children()[1]).remove(); gridCellContentsEl.removeClass('ui-grid-cell-contents-hidden'); if (retainFocus && isFocusedBeforeEdit) { - gridCellContentsEl.focus(); + gridCellContentsEl[0].focus(); } isFocusedBeforeEdit = false; inEdit = false;