Skip to content

Commit 1972dcc

Browse files
Devin Fieldsmportuga
Devin Fields
authored andcommitted
fix(ui-grid-menu.js): Give bySelector correct parent.
fix #5206
1 parent c62b986 commit 1972dcc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/js/core/directives/ui-grid-menu.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,14 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18
294294
$scope.$emit('hide-menu');
295295
} else {
296296
// Maintain focus on the selected item
297-
gridUtil.focus.bySelector(angular.element($event.target.parentElement), 'button[type=button]', true);
297+
var correctParent = $event.target.parentElement;
298+
299+
// nodeName of 'I' means target is i element, need the next parent
300+
if (angular.element($event.target)[0].nodeName === 'I') {
301+
correctParent = correctParent.parentElement;
302+
}
303+
304+
gridUtil.focus.bySelector(correctParent, 'button[type=button]', true);
298305
}
299306
}
300307
};

0 commit comments

Comments
 (0)