Skip to content

Commit

Permalink
Fix Scrollable width consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Mar 14, 2020
1 parent f116818 commit e143877
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/styling/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!"))
Expand Down
4 changes: 2 additions & 2 deletions native/src/widget/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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(
Expand Down

0 comments on commit e143877

Please sign in to comment.