Skip to content

Conversation

@DanBloxham-sw
Copy link
Contributor

Ran all unit tests and tested manually.

} else {
<li class="side-nav__item">
<a class="side-nav__link" href="@Model.Href" asp-all-route-data="@Model.AspAllRouteData">@Model.LinkText</a>
<a class="side-nav__link" href="@Model.Href" asp-all-route-data="@Model.AspAllRouteData" target="@(Model.OpenInNewTab ? "_blank" : null)">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah - we should probably add "noopener" to the true external links (GitHub):
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/noopener

I wonder if it might be worth not reusing this component for these links in that case, so we can keep the component simple by not adding two extra properties just for two extra use cases.. Thoughts? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Do we think there won't be many other side menus with links that need to open in new tabs then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, that link says it is not compatible with IE, I presume we are okay with that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah - could we also add noreferrer to handle IE (I think that's supported on newer IE versions)? 🙏
Re side menus and new tabs - we're not expecting to have any other external links. If it ever changes, we can rethink whether to commonise them :)

Copy link
Contributor

@stellake stellake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@DanBloxham-sw DanBloxham-sw merged commit 3150e0d into master Jul 8, 2021
@DanBloxham-sw DanBloxham-sw deleted the HEEDLS-465-SupportPageOpenLinksInNewTab branch July 8, 2021 11:24
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