Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/LumexUI/Components/Link/LumexLink.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,21 @@ private IReadOnlyDictionary<string, object> Attributes
{
get
{
var attributes = new Dictionary<string, object>()
var attributes = new Dictionary<string, object>();

// Only add href if not disabled
if( !Disabled )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I actually think we should keep the href for semantics. Since a link is not navigable, it won't harm anyway

{
attributes["href"] = Href;
}
else
{
["href"] = Href
};
// For disabled links, add accessibility attributes
attributes["tabindex"] = "-1";
attributes["aria-disabled"] = "true";
}

if( External )
if( External && !Disabled )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And I am not sure that Disabled should affect externality. Is there any specific reason to check if a link is disabled here?

{
attributes["target"] = "_blank";
attributes["rel"] = "noopener noreferrer";
Expand Down