We run into a problem using the Modal component. We have a button at the Payment step that opens a Modal with a form. When the form is submitted, we want to close the modal. We tried using the ui.overlay.close() method and it is also the only way (I believe), but it doesn’t work. The modal remains open.
The weird thing is that if we refresh the page while at the Payment step, it will work as expected. If we refresh the page at other steps, it will not work. Please take a look at the code below:
import {
Button,
Modal,
reactExtension,
useApi,
useBuyerJourneyActiveStep,
} from "@shopify/ui-extensions-react/checkout";
export default reactExtension("purchase.checkout.block.render", () => (
Here is the dependencies version:
“dependencies”: {
“@shopify/ui-extensions”: “2024.4.1”,
“@shopify/ui-extensions-react”: “2024.4.1”,
}
We also tried with the latest version:
“dependencies”: {
“@shopify/ui-extensions”: “2025.1.x”,
“@shopify/ui-extensions-react”: “2025.1.x”,
}
