-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[IndexTable] Fix bulk actions on small screens #6583
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
size-limit report 📦
|
chloerice
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tophatted on iPhone in Safari and Chrome and changes work great, thanks for jumping in to fix this @FCalabria!!
.changeset/nasty-pianos-shout.md
Outdated
| '@shopify/polaris': patch | ||
| --- | ||
|
|
||
| Fix bulk actions not visible on IndexTable on small screens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Fix bulk actions not visible on IndexTable on small screens | |
| Fixed `IndexTable` bulk action visibility on small screens |
| const newSmallScreen = isSmallScreen(); | ||
| if (smallScreen !== newSmallScreen) { | ||
| setSmallScreen(newSmallScreen); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove the conditional here because states only get updated if the value passed to the setter method is not the same as the current value.
| const newSmallScreen = isSmallScreen(); | |
| if (smallScreen !== newSmallScreen) { | |
| setSmallScreen(newSmallScreen); | |
| } | |
| setSmallScreen(isSmallScreen()); |
### WHY are these changes introduced? There was a [change](#6583) that updated how index table behaves on small screens. However, the variable setting small screen state is not correctly updated on resize causing the not to be incorrect when moving from large -> small or small -> large. ### WHAT is this pull request doing? Updating the value on resize ### How to 🎩 Load `indextable--small-screen-with-all-of-its-elements` on a large screen then resize to small. [Spin link](https://admin.web.am-test-it-ba.andrew-musgrave.us.spin.dev/store/shop1/orders?inContextTimeframe=none) ### 🎩 checklist - [ ] 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
WHY are these changes introduced?
Fixes #6405
Fixes #4156
Fixes #5598
(it's the same bug, it is duplicated)
WHAT is this pull request doing?
It copies the mechanism on
ResourceListto keep the bulk actions visible on all screen sizes.Previous

Fixed

Does not affect bigger screens
