Merge pull request #210 from alexkorban/issue197

Add test for issue 197
This commit is contained in:
Matthew Griffith 2020-05-10 10:07:31 -04:00 committed by GitHub
commit dbf8850def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,44 @@
module StackedScrollingColumnsHeight exposing (..)
{-|
# Column height can be set incorrectly for two stacked columns with scrollbarY
<https://github.com/mdgriffith/elm-ui/issues/197>
Both red and green columns should always have equal height.
Currently, the height is set incorrectly if only one column has enough content to scroll.
Both columns are correctly set to the same height only if neither has enough content
to scroll or if both have enough content to scroll.
-}
import Html exposing (Html)
import Testable.Element exposing (..)
import Testable.Element.Background as Background
main : Html msg
main =
layout [ height fill ] <|
column [ height fill ]
[ column
[ height fill
, scrollbarY
, Background.color (rgb 0 255 0)
]
<|
List.map (\_ -> text "Hello") <|
List.range 1 20
, column
[ height fill
, scrollbarY
, Background.color (rgb 255 0 0)
]
<|
List.map (\_ -> text "Hello") <|
List.range 1 3
]