elm-ui icon indicating copy to clipboard operation
elm-ui copied to clipboard

Broken intuition: "Take available space and let me scroll through content"

Open Yagger opened this issue 4 years ago • 2 comments

Sample showing the problem: https://ellie-app.com/8Hwz7S56mQWa1

Workaround with custom CSS: https://ellie-app.com/8HJZYzfLJdca1

Like in most text editors, the textarea field is the main element on the page. Whether it's empty or overflown, we want it to occupy all available space within the context of its parent. If overflown, we want to scroll though the content.

Expected behavior Elm-ui provides an intuitive way of describing such intent: Input.multiline [width fill, height fill, scrollbar] {..}, can be read as "Textarea, take all available space and let me scroll through the content if overflown, stay big if not.".

Actual behavior Textarea grows to its content, expanding the parent.

Versions N/A

Yagger avatar Apr 26 '20 17:04 Yagger

It might be fixable by using min-height: 0 on all row and column elements

dullbananas avatar Jul 20 '22 03:07 dullbananas

see also https://stackoverflow.com/questions/21515042/scrolling-a-flexbox-with-overflowing-content/69889010#69889010

dullbananas avatar Jul 22 '22 04:07 dullbananas