From 461ed9c1732135c857e2de726ae04f81de8549ed Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 28 Jul 2025 18:56:09 +0800 Subject: [PATCH] chore: Fix Slider, Progress width in horizontal mode. (#1096) This bug included since Taffy 0.8 update in [#taffy](https://github.com/zed-industries/zed/pull/34939) --- crates/ui/src/progress.rs | 1 + crates/ui/src/slider.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui/src/progress.rs b/crates/ui/src/progress.rs index f998086b..9810d822 100644 --- a/crates/ui/src/progress.rs +++ b/crates/ui/src/progress.rs @@ -36,6 +36,7 @@ impl RenderOnce for Progress { }); div() + .w_full() .relative() .h(px(self.height)) .rounded(radius) diff --git a/crates/ui/src/slider.rs b/crates/ui/src/slider.rs index 4091420b..80dd8d92 100644 --- a/crates/ui/src/slider.rs +++ b/crates/ui/src/slider.rs @@ -266,10 +266,12 @@ impl RenderOnce for Slider { div() .id(("slider", self.state.entity_id())) + .flex() .flex_1() .when(axis.is_vertical(), |this| { - this.flex().items_center().justify_center() + this.items_center().justify_center() }) + .when(axis.is_horizontal(), |this| this.w_full()) .child( h_flex() .when(!self.disabled, |this| {