diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 47408624..d6f41b04 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -93,6 +93,7 @@ impl Sandbox for Styling { ProgressBar::new(0.0..=100.0, self.slider_value).style(self.theme); let scrollable = Scrollable::new(&mut self.scroll) + .width(Length::Fill) .height(Length::Units(100)) .style(self.theme) .push(Text::new("Scroll me!")) diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index e83f25af..ec9746d4 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -118,7 +118,7 @@ where Renderer: 'static + self::Renderer + column::Renderer, { fn width(&self) -> Length { - Length::Fill + Widget::::width(&self.content) } fn height(&self) -> Length { @@ -132,7 +132,7 @@ where ) -> layout::Node { let limits = limits .max_height(self.max_height) - .width(Length::Fill) + .width(Widget::::width(&self.content)) .height(self.height); let child_limits = layout::Limits::new(