Skip to content

Commit

Permalink
fix(link): bust permanent aria-disabled state (#1807)
Browse files Browse the repository at this point in the history
* fix: a11y set aria-disabled

* test: update snapshots

---------

Co-authored-by: felixw <[email protected]>
  • Loading branch information
felix-ico and felixw authored May 9, 2023
1 parent 5e8dced commit 6d7d93e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Link should contain target="_blank" when openNewTab is set true 1`] = `
<scale-link href="http://example.com" open-new-tab="true">
<mock:shadow-root>
<a href="http://example.com" part="anchor">
<a aria-disabled="false" href="http://example.com" part="anchor">
<div part="content">
<slot></slot>
</div>
Expand Down Expand Up @@ -34,7 +34,7 @@ exports[`Link should handle setted styles 1`] = `
<style>
color:red
</style>
<a href="http://example.com" part="anchor">
<a aria-disabled="false" href="http://example.com" part="anchor">
<div part="content">
<slot></slot>
</div>
Expand All @@ -48,7 +48,7 @@ exports[`Link should handle setted styles 1`] = `
exports[`Link should have link href value when href value is set 1`] = `
<scale-link href="http://example.com">
<mock:shadow-root>
<a href="http://example.com" part="anchor">
<a aria-disabled="false" href="http://example.com" part="anchor">
<div part="content">
<slot></slot>
</div>
Expand All @@ -62,7 +62,7 @@ exports[`Link should have link href value when href value is set 1`] = `
exports[`Link should match snapshot 1`] = `
<scale-link>
<mock:shadow-root>
<a part="anchor">
<a aria-disabled="false" part="anchor">
<div part="content">
<slot></slot>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/link/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class Link {
const props = {
href: this.href || null,
tabIndex: this.disabled ? -1 : this.innerTabindex,
'aria-disabled': this.disabled ? 'true' : false,
'aria-disabled': `${this.disabled}`,
download: this.download || null,
hreflang: this.hreflang || null,
ping: this.ping || null,
Expand Down

0 comments on commit 6d7d93e

Please sign in to comment.