Skip to content

Commit 5c0e11a

Browse files
committed
fix(material-experimental/mdc-progress-spinner): fix aria-valuenow
1 parent fa7ed4c commit 5c0e11a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/material-experimental/mdc-progress-spinner/progress-spinner.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ describe('MDC-based MatProgressSpinner', () => {
323323
fixture.componentInstance.value = 37;
324324
fixture.detectChanges();
325325

326-
expect(progressElement.nativeElement.getAttribute('aria-valuenow')).toBe('0.37');
326+
expect(progressElement.nativeElement.getAttribute('aria-valuenow')).toBe('37');
327327
});
328328

329329
it('should clear `aria-valuenow` in indeterminate mode', () => {

src/material-experimental/mdc-progress-spinner/progress-spinner.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
9595
hasClass: (className: string) => this._elementRef.nativeElement.classList.contains(className),
9696
removeClass: (className: string) => this._elementRef.nativeElement.classList.remove(className),
9797
removeAttribute: (name: string) => this._elementRef.nativeElement.removeAttribute(name),
98-
setAttribute: (name: string, value: string) =>
99-
this._elementRef.nativeElement.setAttribute(name, value),
98+
setAttribute: (name, value) => {
99+
if (name !== 'aria-valuenow') {
100+
this._elementRef.nativeElement.setAttribute(name, value);
101+
}
102+
},
100103
getDeterminateCircleAttribute: (attributeName: string) =>
101104
this._determinateCircle.nativeElement.getAttribute(attributeName),
102105
setDeterminateCircleAttribute: (attributeName: string, value: string) =>

0 commit comments

Comments
 (0)