Menu link with anchor link opening new tab

Hi

I have a menu item that i need to link to a particular section on a page using an anchor (#anchor). Since prismic doesn’t seem so support using an anchor when “Link to a document…”, i am using “Link to the web…” adding a static link to the page.

image

However when clicking the meny item on the page, it opens a new tab, despite having the “Open in new tab” option unchecked.

Here´s the page (the menu item is “Hva koster det?”): https://hoopla-staging.netlify.app/arranger/

Anyone know why this behavior occur?

image

Hi Espen,

I’ll be happy to try and debug this with you.

Have you checked your API browser to see if the field is being return with the field target set to blank, like so?

"target": "_blank"

This will help us figure this out. You can find your browser here:
https://your-repo-name.prismic.io/api/v2

Thanks.

Thanks. Here u go: https://hooplamarketing.prismic.io/api/v2

Great thanks.

So I can see that the target isn’t set to blank on that link “Hva koster det?”, but it is on the link after “Hva er nytt?”:

{
  "menu_item_text": "Hva koster det?",
    -"menu_item_link_url": {
      "link_type": "Web",
      "url": "https://hoopla-staging.netlify.app/arranger/#pris"
    }
},
-{
  "menu_item_text": "Hva er nytt?",
    -"menu_item_link_url": {
      "link_type": "Web",
      "url": "https://announcekit.app/hoopla/nyheter-for-arrangorer",
      "target": "_blank"
    }
}

This would suggest that this is being set in your website application, maybe hardcoded or cached somehow with this setting of target:blank. I inspected the code on the frontend of your website, but there was nothing that I could deduct from there as to why to button opens a new tab.

This issue has been closed due to inactivity.