Skip to content

Conversation

@Anca2022
Copy link
Contributor

@Anca2022 Anca2022 commented Nov 18, 2025

PR Checklist

  • Linked issue added (e.g., Fixes #123)
  • If blog post was added:
    • Ensure images have been optimised
    • Update dates to reflect the actual publishing date when merged (file names, folder names, and frontmatter)

Summary

Linear issue - DEVPORT-12

This PR updates the nav menu to replace non-navigational <a> tags with <button> elements.
These menu items were previously implemented as links with e.preventDefault() in JavaScript to prevent navigation. This worked locally but failed in production (likely due to Astro’s optimization and bundling process affecting script execution timing)

@Anca2022 Anca2022 self-assigned this Nov 18, 2025
@JoblersTune
Copy link
Contributor

Ideally we'd still have the site analytics captured for this click. But I think the root of this issue is from the data-umami-event attribute. We had the same problem with the foundation website. Which is why the foundation website uses data-link-label instead. So we should either copy the same approach here, or include the data-umami-event in the button click.

@JoblersTune
Copy link
Contributor

If you inspect element from the live dev portal and view one of the top level menu items and just remove the data-umami-event attribute, you'll see we get the expected behaviour. That is definitely where the issue is.
While I agree buttons are better, I also like to aim to keep the two sites as identical as possible.

@JoblersTune JoblersTune merged commit 979e6c3 into main Nov 26, 2025
1 check passed
@JoblersTune JoblersTune deleted the am/menu-item-navigation branch November 26, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants