Skip to content

Commit dc30166

Browse files
committed
ProgressBar overflow protection
1 parent d5de06a commit dc30166

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/comp/ProgressBar.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,9 @@
3232
</style>
3333

3434
<div class="progress-bar">
35-
<div class="progress-bar-fill" style={`width: ${(value / max) * 100}%`}></div>
35+
<div
36+
class="progress-bar-fill"
37+
style={`width: ${Math.min(value / max, 1) * 100}%`}
38+
>
39+
</div>
3640
</div>

0 commit comments

Comments
 (0)