Skip to content

Conversation

@chloerice
Copy link
Member

@chloerice chloerice commented Feb 7, 2024

WHY are these changes introduced?

The BulkActions and SelectAllActions UI recently changed so that SelectAllActions renders below the IndexTable and ResourceList and sticks as you scroll. This breaks when IndexTable or ResourceList are within a Modal, because the SelectAllActions are position fixed with no offset.

WHAT is this pull request doing?

This PR adds a bottom offset to the SelectAllActions based on its containing scrollable ancestor's vertical offset. The useIsSelectAllActionsSticky returns the bottom offset that should be set on the wrapper containing SelectAllActions if it's sticky.

Storybook Before After
IndexTable in Modal Screenshot 2024-02-07 at 3 41 16 PM Screenshot 2024-02-07 at 3 40 53 PM
ResourceList in Modal Screenshot 2024-02-07 at 9 47 26 PM Screenshot 2024-02-07 at 9 47 43 PM

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

🎩 checklist

@chloerice chloerice force-pushed the select-all-actions-sticky-modal-bug branch from a45ae9d to 6f883d1 Compare February 8, 2024 01:08
@chloerice chloerice changed the title [IndexTable][ResourceList] Set SelectAllActions sticky bottom offset based on closest Scrollable ancestor [IndexTable][ResourceList] Set SelectAllActions sticky bottom offset based on closest scrollable ancestor Feb 8, 2024
@chloerice chloerice requested a review from mrcthms February 8, 2024 02:40
@chloerice chloerice marked this pull request as ready for review February 8, 2024 02:43
@chloerice chloerice requested a review from boyutf February 8, 2024 02:43
@chloerice
Copy link
Member Author

/snapit

@chloerice chloerice added the #gsd:38846 Admin Quality Improvements (Q1 2024) label Feb 8, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2024

🫰✨ Thanks @chloerice! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20240208025651
yarn add @shopify/polaris@0.0.0-snapshot-release-20240208025651
yarn add @shopify/polaris-tokens@0.0.0-snapshot-release-20240208025651
yarn add @shopify/stylelint-polaris@0.0.0-snapshot-release-20240208025651

@boyutf boyutf requested a review from lbenie February 8, 2024 04:31
Copy link
Contributor

@mrcthms mrcthms left a comment

Choose a reason for hiding this comment

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

This is v. nice, thank you!

@chloerice chloerice requested a review from a team February 8, 2024 20:17
@chloerice chloerice merged commit e7f1961 into main Feb 8, 2024
@chloerice chloerice deleted the select-all-actions-sticky-modal-bug branch February 8, 2024 20:22
sam-b-rose pushed a commit that referenced this pull request Feb 9, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris@12.15.0

### Minor Changes

- [#11552](#11552)
[`04e462816`](04e4628)
Thanks [@sam-b-rose](https://github.com/sam-b-rose)! - Applied native
mobile styles to Button component for the light-mobile theme

### Patch Changes

- [#11570](#11570)
[`e7f1961e1`](e7f1961)
Thanks [@chloerice](https://github.com/chloerice)! - Fixed the position
of `SelectAllActions` when inside of an offset scrollable container

- Updated dependencies
\[[`04e462816`](04e4628)]:
    -   @shopify/polaris-tokens@8.8.0

## @shopify/polaris-tokens@8.8.0

### Minor Changes

- [#11552](#11552)
[`04e462816`](04e4628)
Thanks [@sam-b-rose](https://github.com/sam-b-rose)! - Applied native
mobile styles to Button component for the light-mobile theme

## @shopify/polaris-migrator@0.27.4

### Patch Changes

- Updated dependencies
\[[`04e462816`](04e4628)]:
    -   @shopify/polaris-tokens@8.8.0
    -   @shopify/stylelint-polaris@15.2.2

## @shopify/stylelint-polaris@15.2.2

### Patch Changes

- Updated dependencies
\[[`04e462816`](04e4628)]:
    -   @shopify/polaris-tokens@8.8.0

## polaris-for-vscode@0.9.6

### Patch Changes

- Updated dependencies
\[[`04e462816`](04e4628)]:
    -   @shopify/polaris-tokens@8.8.0

## polaris.shopify.com@0.62.8

### Patch Changes

- Updated dependencies
\[[`04e462816`](04e4628),
[`e7f1961e1`](e7f1961)]:
    -   @shopify/polaris@12.15.0
    -   @shopify/polaris-tokens@8.8.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
…based on closest scrollable ancestor (Shopify#11570)

### WHY are these changes introduced?

The BulkActions and SelectAllActions UI recently changed so that
SelectAllActions renders below the IndexTable and ResourceList and
sticks as you scroll. This breaks when IndexTable or ResourceList are
within a Modal, because the SelectAllActions are position `fixed` with
no offset.

### WHAT is this pull request doing?

This PR adds a bottom offset to the SelectAllActions based on its
containing scrollable ancestor's vertical offset. The
`useIsSelectAllActionsSticky` returns the bottom offset that should be
set on the wrapper containing SelectAllActions if it's sticky.

|Storybook| Before | After |
|--------|--------|--------|
|[IndexTable in
Modal](https://5d559397bae39100201eedc1-pmcjcttzvh.chromatic.com/?path=/story/all-components-indextable--within-a-modal)|![Screenshot
2024-02-07 at 3 41
16 PM](https://github.com/Shopify/polaris/assets/18447883/4fff2215-2658-4a45-adf8-2824a79576c9)
| ![Screenshot 2024-02-07 at 3 40
53 PM](https://github.com/Shopify/polaris/assets/18447883/9f8e3325-08e5-449f-980c-598426d2c0d9)|
|[ResourceList in
Modal](https://5d559397bae39100201eedc1-pmcjcttzvh.chromatic.com/?path=/story/all-components-resourcelist--within-a-modal)
|![Screenshot 2024-02-07 at 9 47
26 PM](https://github.com/Shopify/polaris/assets/18447883/03760536-e501-4771-b6b0-2c7e0db8cde2)|![Screenshot
2024-02-07 at 9 47
43 PM](https://github.com/Shopify/polaris/assets/18447883/0efa889c-5f8b-4732-a615-858825631399)|

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

### 🎩 checklist

- [ ] Tested a
[snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases)
- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:38846 Admin Quality Improvements (Q1 2024)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants