Although we can capture click events on the new <s-app-nav><s-link> app bridge / polaris web components easily enough, there seems to be no way to cancel the full page reload that follows. We can capture clicks and cancel the default event for <s-link slot=”breadcrumb-actions”> but not the main <s-app-nav><s-link> clicks. Is this expected and mandatory behavior, or are embedded apps allowed to handle the main navigation reloads via our own app scripts? Given the below example, the event gets fired, but the page reloads anyway. We want to prevent the occasional app title/heading change flashes that occur annoyingly between app pages when full page reloads are handled by Shopify.
document.querySelectorAll('s-app-nav s-link[href]').forEach(slink => {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
console.log('s-app-nav s-link clicked');
// do internal page load handling such as htmx or turbo-like
return false;
});