Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
86 stars 9 forks source link

App bridge does not sync the hash attribute (fragment) from parent to Iframe URL #142

Open kaarelss opened 2 years ago

kaarelss commented 2 years ago

Describe the bug

We are using hash part of the URL (fragment) to scroll to specific part of the page in our app. When we use navigate function form react-router and pass hash attribute, it is later then reflected in location object. But if we use use full page reload with hash attribute in parent page URL, it is not reflected in Iframe url and is missing in location object. This was working before.

To Reproduce

Steps to reproduce the behaviour:

  1. Navigate to Home page of your app
  2. Copy the url in your browser
  3. Open new tab, paste the URL and add #some_value to the end of the URL and open it
  4. Check the location object
    import { useLocation } from 'react-router-dom';
    const location = useLocation();
    console.log(location);

Expected behaviour

The location object should contain hash: some_value, because app bridge should sync it with Iframe URL.

Contextual information

Packages and versions

List the relevant packages you’re using, and their versions. For example:

Platform

@itissible/matrixify