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

Page backAction does not prevent navigation when SaveBar is showing #12601

Closed
gavinharriss opened this issue Sep 5, 2024 · 1 comment
Closed
Labels
Bug Something is broken and not working as intended in the system. untriaged

Comments

@gavinharriss
Copy link

Summary

The backAction is not working correctly with SaveBar. When the back button is used, the SaveBar shakes but does not prevent the navigation occurring.

Expected behavior

When the backAction button is used and the SaveBar is visible, the SaveBar should shake but navigation should be prevented.

Actual behavior

When the backAction button is used and the SaveBar is visible, the SaveBar shakes but navigation away from the page still happens.

Steps to reproduce

  1. Create a page with backAction and SaveBar component:
import { Page } from "@shopify/polaris";
import { SaveBar } from "@shopify/app-bridge-react";
 <Page 
    title="Add connection"
    backAction={{
      content: "Connections",
      url: "/app/connections",
    }}
  >
    <SaveBar id="my-save-bar">
      <button variant="primary" onClick={handleSave}></button>
      <button onClick={handleDiscard}></button>
    </SaveBar>
    ...
</Page>

shopify.saveBar.show('my-save-bar');

  1. Use backAction to navigate away from the page.

Are you using React components?

Yes

Polaris version number

13.9.0

Browser

Chrome

Device

Windows 11 Pro

@gavinharriss gavinharriss added Bug Something is broken and not working as intended in the system. untriaged labels Sep 5, 2024
@gavinharriss
Copy link
Author

This is a duplicate of Shopify/shopify-app-bridge#416

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. untriaged
Projects
None yet
Development

No branches or pull requests

1 participant