git.iko.soy/typeable/elm-ui
on master help sign in
ensure correct textarea height within Input.multiline
5b6647bMatthew Griffith
src/Element/Input.elm+4−3
@@ -872,7 +872,6 @@ textHelper textInput attrs textOptions =
872 [ Element.clip
872 [ Element.clip
873 , Element.height Element.fill
873 , Element.height Element.fill
874 , Internal.htmlClass classes.inputMultiline
874 , Internal.htmlClass classes.inputMultiline
875− , Element.alpha 0.3
876 , moveUpToCompensateForPadding
875 , moveUpToCompensateForPadding
877 ]
876 ]
878 )
877 )
@@ -890,7 +889,8 @@ textHelper textInput attrs textOptions =
890 Internal.asEl
889 Internal.asEl
891 Internal.div
890 Internal.div
892 ([ Element.width Element.fill
891 ([ Element.width Element.fill
892+
893− , Element.height (Element.px 100)
893+ -- , Element.height (Element.px 100)
894 , Element.scrollbarY
894 , Element.scrollbarY
895 , Internal.htmlClass classes.focusedWithin
895 , Internal.htmlClass classes.focusedWithin
896 ]
896 ]
@@ -903,7 +903,7 @@ textHelper textInput attrs textOptions =
903 (Element.width Element.fill
903 (Element.width Element.fill
904 :: Element.height Element.fill
904 :: Element.height Element.fill
905 :: Element.inFront inputElement
905 :: Element.inFront inputElement
906− :: Internal.htmlClass classes.inputMultiline
906+ :: Internal.htmlClass classes.inputMultilineParent
907 :: List.concat
907 :: List.concat
908 [ if heightContent then
908 [ if heightContent then
909 redistributed.wrapper
909 redistributed.wrapper
@@ -1991,6 +1991,7 @@ defaultTextBoxStyle =
1991 , Border.width 1
1991 , Border.width 1
1992 , Element.spacing 3
1992 , Element.spacing 3
1993 , Element.width Element.fill
1993 , Element.width Element.fill
1994+ , Element.height Element.shrink
1994 ]
1995 ]
1995
1996
1996
1997
src/Internal/Model.elm+2−1
@@ -2758,8 +2758,9 @@ toStyleSheetString options stylesheet =
2758 ]
2758 ]
2759 , renderStyle
2759 , renderStyle
2760 maybePseudo
2760 maybePseudo
2761− ("textarea" ++ class)
2761+ ("textarea" ++ any ++ class)
2762 [ Property "line-height" ("calc(1em + " ++ String.fromInt y ++ "px)")
2762 [ Property "line-height" ("calc(1em + " ++ String.fromInt y ++ "px)")
2763+ , Property "height" ("calc(100% + " ++ String.fromInt y ++ "px)")
2763 ]
2764 ]
2764
2765
2765 -- , renderStyle
2766 -- , renderStyle
src/Internal/Style.elm+13
@@ -252,6 +252,7 @@ classes =
252 -- inputText
252 -- inputText
253 , inputText = "it"
253 , inputText = "it"
254 , inputMultiline = "iml"
254 , inputMultiline = "iml"
255+ , inputMultilineParent = "imlp"
255 }
256 }
256
257
257
258
@@ -1528,8 +1529,20 @@ baseSheet =
1528 ]
1529 ]
1529 , Descriptor (dot classes.inputMultiline)
1530 , Descriptor (dot classes.inputMultiline)
1530 [ Prop "white-space" "pre-wrap"
1531 [ Prop "white-space" "pre-wrap"
1532+ , Prop "height" "100%"
1533+ , Prop "width" "100%"
1534+
1535+ -- , Prop "color" "transparent"
1536+ , Prop "background-color" "transparent"
1537+
1538+ -- , Prop "caret-color" "black"
1539+ ]
1540+ , Descriptor (dot classes.inputMultilineParent)
1541+ [ Prop "white-space" "pre-wrap"
1542+ , Prop "cursor" "text"
1531 , Descriptor (dot classes.paragraph)
1543 , Descriptor (dot classes.paragraph)
1532 [ Prop "white-space" "pre-wrap"
1544 [ Prop "white-space" "pre-wrap"
1545+ , Prop "color" "transparent"
1533 ]
1546 ]
1534 ]
1547 ]
1535 , Descriptor (dot classes.paragraph)
1548 , Descriptor (dot classes.paragraph)