Skip to content

Commit

Permalink
Merge pull request #1121 from Infineon/1012-bug-progress-bar-display-…
Browse files Browse the repository at this point in the history
…of-0-value

Progress bar: fixed bug where label text looked broken
  • Loading branch information
verena-ifx authored Apr 2, 2024
2 parents 0c96f89 + b388cdc commit 3ea0550
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export class ProgressBar {
render() {
return (
<div aria-label='a progress bar' aria-value={this.value} class={`progress-bar ${this.size}`}>
<div class="progress" style={{ width: `${this.internalValue}%` }}>
{this.showLabel && this.size !== "s" && <span class="label">{`${this.internalValue}%`}</span>}
<div class="progress" style={{ width: `${this.internalValue === 0 ? 0 : Math.max(2, this.internalValue)}%` }}>
{this.showLabel && this.size !== "s" && this.internalValue !== 0 && <span class="label">{`${this.internalValue}%`}</span>}
</div>
</div>
);
Expand Down

0 comments on commit 3ea0550

Please sign in to comment.