Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IndexTable] Align IndexTable checkbox header with other headers #3990

Merged
merged 4 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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鈥檚 corner roundness, so it wouldn鈥檛 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