summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/styling/src/main.rs1
-rw-r--r--native/src/widget/scrollable.rs4
2 files changed, 3 insertions, 2 deletions
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::<Message, Renderer>::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::<Message, Renderer>::width(&self.content))
.height(self.height);
let child_limits = layout::Limits::new(