Skip to content

Commit

Permalink
Merge pull request #5186 from crazycactuz/master
Browse files Browse the repository at this point in the history
fix:dropdown losing focus when using scrollToFocus from anoter editfield
  • Loading branch information
dlgski committed Oct 19, 2016
2 parents 9397359 + 0211002 commit 13a1117
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/features/edit/js/gridEdit.js
Expand Up @@ -1115,8 +1115,8 @@
*
*/
module.directive('uiGridEditDropdown',
['uiGridConstants', 'uiGridEditConstants',
function (uiGridConstants, uiGridEditConstants) {
['uiGridConstants', 'uiGridEditConstants', '$timeout',
function (uiGridConstants, uiGridEditConstants, $timeout) {
return {
require: ['?^uiGrid', '?^uiGridRenderContainer'],
scope: true,
Expand All @@ -1131,7 +1131,10 @@

//set focus at start of edit
$scope.$on(uiGridEditConstants.events.BEGIN_CELL_EDIT, function () {
$elm[0].focus();
$timeout(function(){
$elm[0].focus();
});

$elm[0].style.width = ($elm[0].parentElement.offsetWidth - 1) + 'px';
$elm.on('blur', function (evt) {
$scope.stopEdit(evt);
Expand Down

0 comments on commit 13a1117

Please sign in to comment.