Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: a11y set aria-disabled #1807

Merged
merged 2 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
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
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