Skip to content

Commit

Permalink
omit href when not present
Browse files Browse the repository at this point in the history
  • Loading branch information
mdebbar committed May 31, 2024
1 parent 648ced6 commit 2b7967a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/web_ui/lib/src/engine/semantics/link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ class Link extends PrimaryRoleManager {
@override
DomElement createElement() {
final DomElement element = domDocument.createElement('a');
// TODO: The <a> element has `aria-label={value}`. We should stop that!
element.setAttribute('href', semanticsObject.hasValue ? semanticsObject.value! : '#');
if (semanticsObject.hasValue) {
element.setAttribute('href', semanticsObject.value!);
}
element.style.display = 'block';
return element;
}
Expand Down

0 comments on commit 2b7967a

Please sign in to comment.