Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EmptyState/Image] Fix image loading with ref (#11874)
### WHY are these changes introduced? Resolves #11856. EmptyState styles for loaded image were ### WHAT is this pull request doing? Refactors original logic from [#11804](#11804) to use an `HTMLImageElement` ref and the [complete attribute](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/complete) to set loaded image styles. <details> <summary>EmptyState — before</summary> <img src="https://github.com/Shopify/polaris/assets/26749317/959a3bc9-d270-44fa-a916-6655532f82e5" alt="EmptyState — before"> </details> <details> <summary>EmptyState — after</summary> <img src="https://github.com/Shopify/polaris/assets/26749317/9304f32d-a95b-41ea-add9-0e37a01a2704" alt="EmptyState — after"> </details> ### How to 🎩 [Storybook](https://5d559397bae39100201eedc1-oumakptmqa.chromatic.com/?path=/story/all-components-emptystate--default) [Spin](https://admin.web.fix-empty-state-2.lo-kim.us.spin.dev/store/shop1/orders) - For testing Spin instance, it helps to throttle the network to ensure there's enough time to see the transition between placeholder and final loaded asset 🖥 [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 - [x] Tested a [snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases) - [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) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide --------- Co-authored-by: Kyle Durand <[email protected]>
- Loading branch information