-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BulkActions] BulkActions/SelectAllActions UX Tweaks (#7890)
### WHY are these changes introduced? Fixes Shopify/web#79604 The Bulk Actions bar can cause a visual bug whereby the bar disappears if the height of the table/resourcelist changes when the bulk actions bar is visible. This is particularly noticeable when a merchant is filtering on a table with the bulk actions selected. ### WHAT is this pull request doing? This PR updates the `use-is-sticky-bulk-actions` hook to return the `computeTableDimensions` method, which, surprisingly, calculates the dimensions of the table so that we can position the sticky bulk actions bar correctly. We need to return it from the hook so that we can invoke it in both the `IndexTable` and `ResourceList` components, and we listen out for when either the `itemCount` in the `IndexTable` changes, or the `items.length` changes in the `ResourceList`, which as we know that the table will either grow or shrink based on the new value, and the values inside our hook would have to update too as a result to correctly calculate where to place it. We have also fixed a couple of minor bugs related to the BulkActions/SelectAllActions as part of this work, namely: - The placement of the checkbox in the SelectAllActions was off by 2px to the left, so this has been adjusted. - When in select mode, if your IndexTable was sortable, it was still possible to tab through the headings even though they were invisible on the page due to the SelectAllActions. We now remove all sortable functionality from the headings when in this mode. #### Before https://user-images.githubusercontent.com/2562596/207024295-4654585e-f906-4e8d-8664-316610a2d422.mov #### After https://user-images.githubusercontent.com/2562596/207024419-b2f257ca-97a7-44a2-975f-3cbd5db5e740.mov ### Tophatting https://shop1.shopify.all-bulk-work.marc-thomas.eu.spin.dev/admin/orders?inContextTimeframe=none for a Spin link containing the Snapshot release. Note that even after updating search terms and filters for the Index Table, the Bulk Actions always persists in the correct location ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] 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 Co-authored-by: Lo Kim <lo.kim@shopify.com>
- Loading branch information
Showing
11 changed files
with
148 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/polaris': patch | ||
--- | ||
|
||
Fixed display bug with `BulkActions` when content in the table changes at the same time the bulk actions bar is visible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters