A11Y: Header icons should be buttons, not links (#20242)

This commit is contained in:
Kris 2023-02-10 13:55:51 -05:00 committed by GitHub
parent 3e826a67d1
commit 8bc9acc414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -230,7 +230,7 @@ createWidget(
html(attrs) { html(attrs) {
return h( return h(
"a.icon", "button.icon.btn-flat",
{ {
attributes: { attributes: {
"aria-haspopup": true, "aria-haspopup": true,
@ -263,7 +263,7 @@ createWidget(
} }
return h( return h(
"a.icon.btn-flat", "button.icon.btn-flat",
{ {
attributes: { attributes: {
"aria-expanded": attrs.active, "aria-expanded": attrs.active,

View File

@ -117,6 +117,8 @@
float: left; float: left;
} }
.icon { .icon {
box-sizing: content-box;
appearance: none;
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -1,7 +1,7 @@
<a <a
href={{this.href}} href={{this.href}}
tabindex="0" tabindex="0"
class={{concat-class "icon" (if this.isActive "active")}} class={{concat-class "icon btn-flat" (if this.isActive "active")}}
> >
{{d-icon "comment"}} {{d-icon "comment"}}