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

Use text values for boolean ARIA attributes. #259

Merged
merged 1 commit into from
Dec 7, 2019
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 @@ -70,7 +70,7 @@ export class CalciteAccordionItem {
<Host
dir={dir}
tabindex="0"
aria-expanded={this.active ? "true" : "false"}
aria-expanded={this.active.toString()}
>
<div class="accordion-item-header" onClick={this.itemHeaderClickHander}>
<span class="accordion-item-title">{this.itemTitle}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-checkbox/calcite-checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class CalciteCheckbox {
return (
<Host
role="checkbox"
aria-checked={this.checked}
aria-checked={this.checked.toString()}
tabindex={this.disabled ? "-1" : "0"}
>
<svg class="check-svg" viewBox="0 0 16 16">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class CalciteDropdownItem {
scale={scale}
tabindex="0"
role="menuitem"
aria-selected={this.active ? "true" : "false"}
aria-selected={this.active.toString()}
>
<slot />
</Host>
Expand All @@ -103,7 +103,7 @@ export class CalciteDropdownItem {
scale={scale}
tabindex="0"
role="menuitem"
aria-selected={this.active ? "true" : "false"}
aria-selected={this.active.toString()}
isLink
>
<a href={this.href} title={this.linkTitle}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class CalciteRadioGroupItem {
return (
<Host
role="radio"
aria-checked={checked ? "true" : "false"}
aria-checked={checked.toString()}
scale={scale}
>
<label>
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-switch/calcite-switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class CalciteSwitch {
render() {
const dir = getElementDir(this.el);
return (
<Host role="checkbox" dir={dir} aria-checked={this.switched} tabindex="0">
<Host role="checkbox" dir={dir} checked={this.switched.toString()} tabindex="0">
<div class="track">
<div class="handle" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-tab-title/calcite-tab-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class CalciteTabTitle {
<Host
id={id}
aria-controls={this.controls}
aria-expanded={this.isActive ? "true" : "false"}
aria-expanded={this.isActive.toString()}
role="tab"
tabindex="0"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-tab/calcite-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class CalciteTab {
<Host
id={id}
aria-labeledby={this.labeledBy}
aria-expanded={this.isActive ? "true" : "false"}
aria-expanded={this.isActive.toString()}
role="tabpanel"
>
<section>
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-tree-item/calcite-tree-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class CalciteTreeItem {
: undefined
}
aria-expanded={
this.hasChildren ? (this.expanded ? "true" : "false") : undefined
this.hasChildren ? this.expanded.toString() : undefined
}
>
<div class="calcite-tree-node" ref={el => (this.defaultSlotWrapper = el as HTMLElement)}>
Expand Down