Skip to content

Commit 25b140d

Browse files
mmalerbaAngular Material Team
andcommitted
refactor(material-experimental/mdc-progress-bar): update mdc-progress-bar to be compatible with API changes in MDC (#21599)
* refactor(material-experimental/mdc-progress-bar): update mdc-progress-bar to be compatible with API changes in MDC PiperOrigin-RevId: 351815658 * fixup! refactor(material-experimental/mdc-progress-bar): update mdc-progress-bar to be compatible with API changes in MDC Co-authored-by: Angular Material Team <material@angular.io> (cherry picked from commit 5d7ce50)
1 parent 3955edc commit 25b140d

File tree

3 files changed

+599
-589
lines changed

3 files changed

+599
-589
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/youtube": "^0.0.40",
6464
"@webcomponents/custom-elements": "^1.1.0",
6565
"core-js-bundle": "^3.8.2",
66-
"material-components-web": "10.0.0-canary.968735356.0",
66+
"material-components-web": "10.0.0-canary.b2faa116a.0",
6767
"rxjs": "^6.5.3",
6868
"rxjs-tslint-rules": "^4.33.1",
6969
"systemjs": "0.19.43",

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)