Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f

- Fixed `Action`s selector in `Page`'s `Header` component ([#2487](https://github.com/Shopify/polaris-react/pull/2487))
- Fixed `Card` spacing in small devices ([#608](https://github.com/shopify/polaris-react/pull/608))
- Fixed `ResourceList` `BulkActions` that were remaining in fixed position outside the `boundingElement` ([#627](https://github.com/Shopify/polaris-react/pull/627))
- Improved readability of `Badge` with `size` small and `status` new for navigation ([#633](https://github.com/shopify/polaris-react/pull/633))

### Documentation
Expand Down
63 changes: 32 additions & 31 deletions src/components/ResourceList/ResourceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,38 +441,39 @@ export class ResourceList extends React.Component<CombinedProps, State> {
<div className={styles['HeaderWrapper-overlay']} />
) : null;

const headerMarkup = (showHeader || needsHeader) && (
<div className={styles.HeaderOuterWrapper}>
<Sticky boundingElement={listNode}>
{(isSticky: boolean) => {
const headerClassName = classNames(
styles.HeaderWrapper,
sortOptions &&
sortOptions.length > 0 &&
styles['HeaderWrapper-hasSort'],
this.selectable && styles['HeaderWrapper-hasSelect'],
loading && styles['HeaderWrapper-disabled'],
this.selectable &&
selectMode &&
styles['HeaderWrapper-inSelectMode'],
isSticky && styles['HeaderWrapper-isSticky'],
);
return (
<div className={headerClassName} testID="ResourceList-Header">
{headerWrapperOverlay}
<div className={styles.HeaderContentWrapper}>
{headerTitleMarkup}
{checkableButtonMarkup}
{sortingSelectMarkup}
{selectButtonMarkup}
const headerMarkup = (showHeader || needsHeader) &&
listNode && (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply brought back this listNode check before rendering the list header.

<div className={styles.HeaderOuterWrapper}>
<Sticky boundingElement={listNode}>
{(isSticky: boolean) => {
const headerClassName = classNames(
styles.HeaderWrapper,
sortOptions &&
sortOptions.length > 0 &&
styles['HeaderWrapper-hasSort'],
this.selectable && styles['HeaderWrapper-hasSelect'],
loading && styles['HeaderWrapper-disabled'],
this.selectable &&
selectMode &&
styles['HeaderWrapper-inSelectMode'],
isSticky && styles['HeaderWrapper-isSticky'],
);
return (
<div className={headerClassName} testID="ResourceList-Header">
{headerWrapperOverlay}
<div className={styles.HeaderContentWrapper}>
{headerTitleMarkup}
{checkableButtonMarkup}
{sortingSelectMarkup}
{selectButtonMarkup}
</div>
{bulkActionsMarkup}
</div>
{bulkActionsMarkup}
</div>
);
}}
</Sticky>
</div>
);
);
}}
</Sticky>
</div>
);

const emptyStateMarkup =
filterControl && !itemsExist && !loading ? (
Expand Down