mirror of
https://github.com/material-components/material-web.git
synced 2024-10-26 13:40:03 +03:00
Added null check for buffer (due to possibility of attribute removal)
This commit is contained in:
parent
8fa444c986
commit
e4b8ef521f
@ -31,14 +31,15 @@ export class LinearProgress extends Progress {
|
||||
};
|
||||
const dotStyles = {
|
||||
transform: `scaleX(${
|
||||
(this.indeterminate || this.buffer < 0 ? 1 : this.buffer / this.max) * 100
|
||||
// == null is used to check for both null and undefined when buffer attribute is removed
|
||||
(this.indeterminate || this.buffer == null || this.buffer < 0 ? 1 : this.buffer / this.max) * 100
|
||||
}%)`,
|
||||
};
|
||||
|
||||
// Only display dots when visible - this prevents invisible infinite
|
||||
// animation.
|
||||
const hideDots =
|
||||
this.indeterminate || this.buffer < 0 || this.buffer >= this.max || this.value >= this.max;
|
||||
this.indeterminate || this.buffer == null || this.buffer < 0 || this.buffer >= this.max || this.value >= this.max;
|
||||
return html`
|
||||
<div class="dots" ?hidden=${hideDots}></div>
|
||||
<div class="inactive-track" style=${styleMap(dotStyles)}></div>
|
||||
|
Loading…
Reference in New Issue
Block a user