Hi everyone,
I’m building a Customer Account UI ext (Preact + Polaris web components) on the new customer accounts, API version 2026-07.
I’d like to replicate the same behavior that Shopify uses in the native marketing preferences UI:
a switch on the profile page that, when the customer tries to turn it OFF, opens a confirmation modal before the change is applied.
I’m using the Polaris s-switch and s-modal components. According to the docs, s-switch supports command and commandFor, and s-modal is opened via overlay commands (command/commandFor).
However, when I try to point s-switch at a s-modal, I get this warning in the console:
Command "--auto" targets "marketing-modal" but Component does not support overlay commands.
This suggests that s-switch cannot be used as a command source for modals, even though it has command/commandFor.
My questions for the community:
- Is it officially unsupported to use
s-switchto controls-modal(overlay commands)? - Is there any supported pattern or API to open a
s-modalfrom a switch interaction (e.g. only when toggling from ON → OFF), similar to what Shopify does for its native marketing preferences?
Thanks in advance!