Skip to content

Commit 228c10a

Browse files
Angular Material Teammmalerba
authored andcommitted
refactor(material-experimental/mdc-progress-bar): update
mdc-progress-bar to be compatible with API changes in MDC PiperOrigin-RevId: 351815658
1 parent 098df82 commit 228c10a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,14 @@ export class MatProgressBar extends _MatProgressBarMixinBase implements AfterVie
199199
const direction = this._dir ? this._dir.value : 'ltr';
200200
const mode = this.mode;
201201

202-
foundation.setReverse(direction === 'rtl' ? mode !== 'query' : mode === 'query');
202+
const reverse = direction === 'rtl' ? mode !== 'query' : mode === 'query';
203+
const progressDirection = reverse ? 'rtl' : 'ltr';
204+
const currentDirection = this._rootElement.getAttribute('dir');
205+
if (currentDirection !== progressDirection) {
206+
this._rootElement.setAttribute('dir', progressDirection);
207+
foundation.restartAnimation();
208+
}
209+
203210
foundation.setDeterminate(mode !== 'indeterminate' && mode !== 'query');
204211

205212
// Divide by 100 because MDC deals with values between 0 and 1.

0 commit comments

Comments
 (0)