Skip to content

Commit 13a1117

Browse files
authored
Merge pull request #5186 from crazycactuz/master
fix:dropdown losing focus when using scrollToFocus from anoter editfield
2 parents 9397359 + 0211002 commit 13a1117

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
@@ -1115,8 +1115,8 @@
11151115
*
11161116
*/
11171117
module.directive('uiGridEditDropdown',
1118-
['uiGridConstants', 'uiGridEditConstants',
1119-
function (uiGridConstants, uiGridEditConstants) {
1118+
['uiGridConstants', 'uiGridEditConstants', '$timeout',
1119+
function (uiGridConstants, uiGridEditConstants, $timeout) {
11201120
return {
11211121
require: ['?^uiGrid', '?^uiGridRenderContainer'],
11221122
scope: true,
@@ -1131,7 +1131,10 @@
11311131

11321132
//set focus at start of edit
11331133
$scope.$on(uiGridEditConstants.events.BEGIN_CELL_EDIT, function () {
1134-
$elm[0].focus();
1134+
$timeout(function(){
1135+
$elm[0].focus();
1136+
});
1137+
11351138
$elm[0].style.width = ($elm[0].parentElement.offsetWidth - 1) + 'px';
11361139
$elm.on('blur', function (evt) {
11371140
$scope.stopEdit(evt);

0 commit comments

Comments
 (0)