Skip to content

Commit c979846

Browse files
Fix Fast progress indicator height (#8652)
Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
1 parent ea7d17e commit c979846

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

panel/models/progress.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export class ProgressView extends HTMLBoxView {
2525
override render(): void {
2626
super.render()
2727
const style: any = {...this.model.styles, display: "inline-block"}
28+
if (this.model.height != null) {
29+
style.height = `${this.model.height}px`
30+
}
2831
this.progressEl = document.createElement("progress")
2932
this.setValue()
3033
this.setMax()

panel/tests/ui/widgets/test_indicators.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
import panel as pn
99

1010
from panel.tests.util import serve_component, wait_until
11+
from panel.theme import Fast
1112
from panel.widgets import TooltipIcon
12-
from panel.widgets.indicators import Gauge
13+
from panel.widgets.indicators import Gauge, Progress
1314

1415
pytestmark = pytest.mark.ui
1516

@@ -133,3 +134,23 @@ def test_gauge_value_update(page):
133134

134135
# Canvas should still be present after update
135136
expect(page.locator("canvas")).to_have_count(1, timeout=5000)
137+
138+
139+
def test_fast_progress_indicator_height(page):
140+
progress = Progress(value=20, design=Fast)
141+
142+
serve_component(page, progress)
143+
144+
progress_el = page.locator("progress")
145+
expect(progress_el).to_have_count(1)
146+
expect(progress_el).to_have_css("height", "20px")
147+
148+
149+
def test_fast_progress_indicator_explicit_height(page):
150+
progress = Progress(value=20, height=32, design=Fast)
151+
152+
serve_component(page, progress)
153+
154+
progress_el = page.locator("progress")
155+
expect(progress_el).to_have_count(1)
156+
expect(progress_el).to_have_css("height", "32px")

panel/theme/css/fast.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,6 @@ select:not([size]).bk-input {
805805

806806
progress {
807807
border-radius: calc(var(--corner-radius) * 1px);
808-
height: 5px;
809808
margin: 0 0 0.5em;
810809
}
811810

@@ -831,7 +830,6 @@ progress:not([value])::-webkit-progress-bar {
831830

832831
progress:not([value])::before {
833832
border-radius: calc(var(--corner-radius) * 1px);
834-
height: 5px;
835833
}
836834

837835
/* Panes */

0 commit comments

Comments
 (0)