Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Modal] Activator no longer wrapped in Box (#10086)
### WHY are these changes introduced? Fixes Shopify/polaris-internal#1049 Because `<Modal />` wraps the `activator` in a `<Box />`, it is not possible to style elements inline. The `<Box />` can be removed as it is only used for passing the ref along, which we can pass to the activator instead with `React.cloneElement`. ### WHAT is this pull request doing? <details> <summary>1. Modal activator is no longer wrapped in a Box</summary> BEFORE: ```jsx <div class="Polaris-Box"> <button class="Polaris-Button" type="button"> <span class="Polaris-Button__Content"> <span class="Polaris-Button__Text">Click Me</span> </span> </button> </div> ``` AFTER: ```jsx <button class="Polaris-Button" type="button"> <span class="Polaris-Button__Content"> <span class="Polaris-Button__Text">Click Me</span> </span> </button> ``` </details> 2. The `ref` is attached to the `activator` instead of the box which used to wrap the `activator`. ### 🎩 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) - [X] 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
- Loading branch information