Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Milan Raj <rajsite@users.noreply.github.com>
  • Loading branch information
m-akinc and rajsite authored May 21, 2024
1 parent c94b78a commit bbb59ea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/nimble-components/src/checkbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export class Checkbox extends FoundationCheckbox {
/**
* @internal
*/
public get resolvedTabIndex(): string | undefined {
public get resolvedTabindex(): string | undefined {
const tabIndex = this.tabIndex ?? 0;
return this.disabled ? undefined : tabIndex.toString();
return this.disabled ? undefined : `${tabIndex}`;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/nimble-components/src/checkbox/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CheckboxOptions
aria-required="${x => x.required}"
aria-disabled="${x => x.disabled}"
aria-readonly="${x => x.readOnly}"
tabindex="${x => x.resolvedTabIndex}"
tabindex="${x => x.resolvedTabindex}"
@keypress="${(x, c) => x.keypressHandler(c.event as KeyboardEvent)}"
@click="${(x, c) => x.clickHandler(c.event as MouseEvent)}"
class="${x => (x.readOnly ? 'readonly' : '')} ${x => (x.checked ? 'checked' : '')} ${x => (x.indeterminate ? 'indeterminate' : '')}"
Expand Down
4 changes: 2 additions & 2 deletions packages/nimble-components/src/toggle-button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export class ToggleButton extends FoundationSwitch implements ButtonPattern {
/**
* @internal
*/
public get resolvedTabIndex(): string | undefined {
public get resolvedTabindex(): string | undefined {
const tabIndex = this.tabIndex ?? 0;
return this.disabled ? undefined : tabIndex.toString();
return this.disabled ? undefined : `${tabIndex}`;
}
}
applyMixins(ToggleButton, StartEnd, DelegatesARIAButton);
Expand Down
2 changes: 1 addition & 1 deletion packages/nimble-components/src/toggle-button/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ButtonOptions
<div
role="button"
part="control"
tabindex="${x => x.resolvedTabIndex}"
tabindex="${x => x.resolvedTabindex}"
@keypress="${(x, c) => x.keypressHandler(c.event as KeyboardEvent)}"
@click="${(x, c) => x.clickHandler(c.event as MouseEvent)}"
class="control ${x => (x.checked ? 'checked' : '')}"
Expand Down

0 comments on commit bbb59ea

Please sign in to comment.