The ChannelMenu active option is ignored and instead appears to guess the active link based on the current pathname (something like location.pathname.startsWith(appLink.destination).
EXPECT: No link to be active
ACTUAL: `settingsLink` is active
### Expected behaviour
The channel menu should not ignore the `active` option and highlight the item passed in, irrespective of url.
## Contextual information
Our app link destination paths go via a proxy url to carry across the shop + host state, which redirects to the actual path. e.g.
```ts
const itemsLink = AppLink.create(app, {
label: 'Items',
destination: '/proxy/items', // use proxy url because app links don't support query params
});
// /proxy/items -> /items?shop=foo.myshopify.com&host=123
Describe the bug
The ChannelMenu
active
option is ignored and instead appears to guess the active link based on the current pathname (something likelocation.pathname.startsWith(appLink.destination)
.To Reproduce
Visit an app at a url other than /items or /settings (e.g. /account)
Execute the following code
EXPECT:
settingsLink
to be active ACTUAL: No links are activeVisit an app at /settings
Execute the following code
const channelMenu = ChannelMenu.create(app, { items: [itemsLink, settingsLink], active: undefined, });
Packages and versions
@shopify/app-bridge
@3.1.4
@shopify/app-bridge-react
@3.1.4
@shopify/polaris
@9.22.0
Platform