Skip to content

Commit

Permalink
[DataGrid] Fix aria-label value for group checkboxes (#15861)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi authored Dec 16, 2024
1 parent ab1be6a commit 761f3ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ const GridCellCheckboxForwardRef = React.forwardRef<HTMLInputElement, GridRender
return null;
}

const label = apiRef.current.getLocaleText(
isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow',
);

const checked =
rootProps.indeterminateCheckboxAction === 'select'
? isChecked && !isIndeterminate
: isChecked;

const label = apiRef.current.getLocaleText(
checked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow',
);

return (
<rootProps.slots.baseCheckbox
ref={handleRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ const GridHeaderCheckbox = React.forwardRef<HTMLButtonElement, GridColumnHeaderP
return apiRef.current.subscribeEvent('rowSelectionChange', handleSelectionChange);
}, [apiRef, handleSelectionChange]);

const label = apiRef.current.getLocaleText(
isChecked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows',
);

const checked =
rootProps.indeterminateCheckboxAction === 'select'
? isChecked && !isIndeterminate
: isChecked;

const label = apiRef.current.getLocaleText(
checked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows',
);

return (
<rootProps.slots.baseCheckbox
ref={ref}
Expand Down

0 comments on commit 761f3ec

Please sign in to comment.