Skip to content

Commit

Permalink
fix(material-experimental/mdc-slide-toggle): remove aria-required rat…
Browse files Browse the repository at this point in the history
…her than setting to false (#24105)

Both are equally valid to mark the control as not required, but setting
it to false generates a bunch of false-positive lint errors in google3
  • Loading branch information
mmalerba authored Dec 17, 2021
1 parent 05efadb commit 2cc0640
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[attr.aria-label]="ariaLabel"
[attr.aria-labelledby]="_getAriaLabelledBy()"
[attr.aria-describedby]="ariaDescribedby"
[attr.aria-required]="required"
[attr.aria-required]="required || null"
(click)="_handleClick($event)"
#switch>
<div class="mdc-switch__track"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('MDC-based MatSlideToggle without forms', () => {
testComponent.isRequired = false;
fixture.detectChanges();

expect(buttonElement.getAttribute('aria-required')).toBe('false');
expect(buttonElement.getAttribute('aria-required')).toBe(null);
});

it('should focus on underlying element when focus() is called', fakeAsync(() => {
Expand Down

0 comments on commit 2cc0640

Please sign in to comment.