Skip to content

Commit 0211002

Browse files
committed
fix: Fix for dropdown losing focus when using scrollToFocus from another editfield
1 parent ff54930 commit 0211002

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/features/edit/js/gridEdit.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1117,8 +1117,8 @@
11171117
*
11181118
*/
11191119
module.directive('uiGridEditDropdown',
1120-
['uiGridConstants', 'uiGridEditConstants',
1121-
function (uiGridConstants, uiGridEditConstants) {
1120+
['uiGridConstants', 'uiGridEditConstants', '$timeout',
1121+
function (uiGridConstants, uiGridEditConstants, $timeout) {
11221122
return {
11231123
require: ['?^uiGrid', '?^uiGridRenderContainer'],
11241124
scope: true,
@@ -1133,7 +1133,10 @@
11331133

11341134
//set focus at start of edit
11351135
$scope.$on(uiGridEditConstants.events.BEGIN_CELL_EDIT, function () {
1136-
$elm[0].focus();
1136+
$timeout(function(){
1137+
$elm[0].focus();
1138+
});
1139+
11371140
$elm[0].style.width = ($elm[0].parentElement.offsetWidth - 1) + 'px';
11381141
$elm.on('blur', function (evt) {
11391142
$scope.stopEdit(evt);

0 commit comments

Comments
 (0)