What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Plain JavaScript app bridge NavigationMenu can't make home nav item active

Solved

Plain JavaScript app bridge NavigationMenu can't make home nav item active

MartyBoggs
Shopify Partner
9 1 0

Hello,

 

Whenever I run this code, instead of the main navigation item (the app name) being highlighted, the first nav item is highlighted. I tried different versions of the app bridge library at unpkg.com as well as the new CDN version, but it's always the same problem.

 

It was working for about 24 hrs a few days ago, so maybe I should just wait for Shopify to fix the problem.

 

 

 

 

var installLink = AppBridge.actions.AppLink.create(app, {
	label: 'Install',
	destination: '/?status=install',
});
var navigationMenu = AppBridge.actions.NavigationMenu.create(app, {
	items: [installLink]
});
navigationMenu.set({active: undefined});

 

 

 

 

Accepted Solution (1)

MartyBoggs
Shopify Partner
9 1 0

This is an accepted solution.

Looks like the problem was the query parameter destination /?status=install. I changed it to /install

View solution in original post

Reply 1 (1)

MartyBoggs
Shopify Partner
9 1 0

This is an accepted solution.

Looks like the problem was the query parameter destination /?status=install. I changed it to /install