Skip to content
Open
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
1 change: 1 addition & 0 deletions src/lib/ui-switch/ui-switch.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
type="button"
class="switch"
role="switch"
[disabled]="disabled"
Copy link
Collaborator

@cmckni3 cmckni3 Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[disabled]="disabled"
[attr.disabled]="disabled ? 'disabled' : null"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give this change a try, but I don't think it works with the disabled attribute. I've had issues in the past where you end up with disabled="false" in the DOM, and the element is actually disabled.

Copy link
Collaborator

@cmckni3 cmckni3 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah. That's right.

It's due to being an attribute. Luckily, this is a button. It should be disabled="disabled" when actually disabling or not have the the attribute at all.

See updated suggestion and let me know if that helps.

[attr.aria-checked]="reverse ? !checked : checked"
[attr.aria-label]="ariaLabel"
[class.checked]="reverse ? !checked : checked"
Expand Down