From 8fa444c9861264cdbb3f38a2c2722bc99ec17747 Mon Sep 17 00:00:00 2001 From: Luke Vo Date: Wed, 27 Dec 2023 16:26:06 -0600 Subject: [PATCH] fix(progress): progress buffer defaults to negative. --- progress/internal/linear-progress.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/progress/internal/linear-progress.ts b/progress/internal/linear-progress.ts index 46176782b..69757b42e 100644 --- a/progress/internal/linear-progress.ts +++ b/progress/internal/linear-progress.ts @@ -16,8 +16,9 @@ import {Progress} from './progress.js'; export class LinearProgress extends Progress { /** * Buffer amount to display, a fraction between 0 and `max`. + * If negative, the buffer is not displayed. */ - @property({type: Number}) buffer = 1; + @property({type: Number}) buffer = -1; // Note, the indeterminate animation is rendered with transform %'s // Previously, this was optimized to use px calculated with the resizeObserver @@ -30,14 +31,14 @@ export class LinearProgress extends Progress { }; const dotStyles = { transform: `scaleX(${ - (this.indeterminate ? 1 : this.buffer / this.max) * 100 + (this.indeterminate || 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 >= this.max || this.value >= this.max; + this.indeterminate || this.buffer < 0 || this.buffer >= this.max || this.value >= this.max; return html`