|
708 | 708 | link: function ($scope, $elm, $attrs, uiGridCtrl) {
|
709 | 709 | var self = uiGridCtrl.grid;
|
710 | 710 | $scope.selectButtonClick = selectButtonClick;
|
| 711 | + $scope.selectButtonKeyDown = selectButtonKeyDown; |
711 | 712 |
|
712 | 713 | // On IE, prevent mousedowns on the select button from starting a selection.
|
713 | 714 | // If this is not done and you shift+click on another row, the browser will select a big chunk of text
|
714 | 715 | if (gridUtil.detectBrowser() === 'ie') {
|
715 | 716 | $elm.on('mousedown', selectButtonMouseDown);
|
716 | 717 | }
|
717 | 718 |
|
| 719 | + function selectButtonKeyDown(row, evt) { |
| 720 | + if (evt.keyCode === 32) { |
| 721 | + evt.preventDefault(); |
| 722 | + selectButtonClick(row, evt); |
| 723 | + } |
| 724 | + } |
718 | 725 |
|
719 | 726 | function selectButtonClick(row, evt) {
|
720 | 727 | evt.stopPropagation();
|
|
759 | 766 | link: function ($scope, $elm, $attrs, uiGridCtrl) {
|
760 | 767 | var self = $scope.col.grid;
|
761 | 768 |
|
762 |
| - $scope.headerButtonClick = function (row, evt) { |
| 769 | + $scope.headerButtonKeyDown = function (evt) { |
| 770 | + if (evt.keyCode === 32 || evt.keyCode === 13) { |
| 771 | + evt.preventDefault(); |
| 772 | + $scope.headerButtonClick(evt); |
| 773 | + } |
| 774 | + }; |
| 775 | + |
| 776 | + $scope.headerButtonClick = function (evt) { |
763 | 777 | if (self.selection.selectAll) {
|
764 | 778 | uiGridSelectionService.clearSelectedRows(self, evt);
|
765 | 779 | if (self.options.noUnselect) {
|
|
846 | 860 | }
|
847 | 861 |
|
848 | 862 | if (evt.keyCode === 32 && $scope.col.colDef.name === "selectionRowHeaderCol") {
|
| 863 | + evt.preventDefault(); |
849 | 864 | uiGridSelectionService.toggleRowSelection($scope.grid, $scope.row, evt, ($scope.grid.options.multiSelect && !$scope.grid.options.modifierKeysToMultiSelect), $scope.grid.options.noUnselect);
|
850 | 865 | $scope.$apply();
|
851 | 866 | }
|
|
0 commit comments