Skip to content
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

Modal element does not support StyleHelper #2500

Closed
catalin-invisible opened this issue Nov 27, 2024 · 1 comment
Closed

Modal element does not support StyleHelper #2500

catalin-invisible opened this issue Nov 27, 2024 · 1 comment
Labels
bug Something isn't working Checkout UI Components This issue is related to the Checkout UI component library Checkout UI Extensions

Comments

@catalin-invisible
Copy link

Please list the package(s) involved in the issue, and include the version you are using

"@shopify/checkout-ui-extensions-react": "^0.27.3"

Describe the bug

I'm trying to make the size prop of the Modal element dynamic:

<Modal size={Style.default('large').when({ viewportInlineSize: { min: 'medium' } }, 'max')}>

but it doesn't actually work.

When I'm trying this approach with other elements like View, Grid, the StyleHelper works just fine.

Steps to reproduce the behavior:

In a basic Checkout UI Extension, add a Modal component:

<Modal size={Style.default('large').when({ viewportInlineSize: { min: 'medium' } }, 'max')}>
    <View padding="extraLoose">Modal content</View>
</Modal>

Expected behavior

When size is statically set with size="max":

<Modal size="max">
    <View padding="extraLoose">Modal content</View>
</Modal>

The modal shows up normally on a 1920px screen width:
Image

However, when it is set with a dynamic value

<Modal size={Style.default('max')}>
    <View padding="extraLoose">Modal content</View>
</Modal>

it shows up differently:

Image

@catalin-invisible catalin-invisible added the bug Something isn't working label Nov 27, 2024
@simontaisne simontaisne added Checkout UI Components This issue is related to the Checkout UI component library Checkout UI Extensions labels Dec 19, 2024
@simontaisne
Copy link
Member

Hello @catalin-invisible, thanks for your report. The Modal size prop doesn't support responsive conditional styles, but it should already adapt responsively to the screen size.

@simontaisne simontaisne closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Checkout UI Components This issue is related to the Checkout UI component library Checkout UI Extensions
Projects
None yet
Development

No branches or pull requests

2 participants