Skip to content

Commit

Permalink
[IndexTable] Align IndexTable checkbox header with other headers (#3990)
Browse files Browse the repository at this point in the history
* 3989: Align IndexTable checkbox header
  • Loading branch information
lhoffbeck authored and sylvhama committed Mar 26, 2021
1 parent 8013f28 commit 3169a8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- Made items in `ActionList` more clear in high contrast mode ([#3971](https://github.com/Shopify/polaris-react/pull/3971))
- Fixed the MediaCard thumbnail’s corner roundness, so it wouldn’t overflow out of the parent Card ([#3974](https://github.com/Shopify/polaris-react/issues/3974))
- Fixed `ActionList` `Item` not disabling properly when url prop is passed ([#3979](https://github.com/Shopify/polaris-react/pull/3979))
- Update `IndexTable`'s checkbox header to be aligned with other headers ([#3990](https://github.com/Shopify/polaris-react/issues/3990))
- Fixed `CheckableButton` missing border when focused ([#3987](https://github.com/Shopify/polaris-react/issues/3987))

### Documentation
Expand Down
4 changes: 4 additions & 0 deletions src/components/IndexTable/IndexTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ $loading-panel-height: rem(53px);
padding-right: $checkbox-offset-right;
}

.ColumnHeaderCheckboxWrapper {
display: flex;
}

.StickyColumnHeaderCheckbox {
margin-left: #{-1 * $small-checkbox-offset};
padding-right: $small-checkbox-offset;
Expand Down
18 changes: 10 additions & 8 deletions src/components/IndexTable/IndexTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,16 @@ function IndexTableBase({

function renderCheckboxContent() {
return (
<PolarisCheckbox
label={i18n.translate('Polaris.IndexTable.selectAllLabel', {
resourceNamePlural: resourceName.plural,
})}
labelHidden
onChange={handleSelectPage}
checked={bulkSelectState}
/>
<div className={styles.ColumnHeaderCheckboxWrapper}>
<PolarisCheckbox
label={i18n.translate('Polaris.IndexTable.selectAllLabel', {
resourceNamePlural: resourceName.plural,
})}
labelHidden
onChange={handleSelectPage}
checked={bulkSelectState}
/>
</div>
);
}

Expand Down

0 comments on commit 3169a8d

Please sign in to comment.