git.iko.soy/typeable/elm-ui
on master help sign in
ensure correct textarea height within Input.multiline
commit5b6647b443dc2b4b95e4bdd0500abd7dcf5f6832 authorMatthew Griffith <mdg.griffith@gmail.com> dateTue 2 Jul 2019, 08:46 (7 years ago) parentdc1f301
3 files changed+19−4
src/Element/Input.elm+4−3 src/Internal/Model.elm+2−1 src/Internal/Style.elm+13
src/Element/Input.elm+4−3
@@ -872,7 +872,6 @@ textHelper textInput attrs textOptions =
872872 [ Element.clip
873873 , Element.height Element.fill
874874 , Internal.htmlClass classes.inputMultiline
875− , Element.alpha 0.3
876875 , moveUpToCompensateForPadding
877876 ]
878877 )
@@ -890,7 +889,8 @@ textHelper textInput attrs textOptions =
890889 Internal.asEl
891890 Internal.div
892891 ([ Element.width Element.fill
893− , Element.height (Element.px 100)
892+
893+ -- , Element.height (Element.px 100)
894894 , Element.scrollbarY
895895 , Internal.htmlClass classes.focusedWithin
896896 ]
@@ -903,7 +903,7 @@ textHelper textInput attrs textOptions =
903903 (Element.width Element.fill
904904 :: Element.height Element.fill
905905 :: Element.inFront inputElement
906− :: Internal.htmlClass classes.inputMultiline
906+ :: Internal.htmlClass classes.inputMultilineParent
907907 :: List.concat
908908 [ if heightContent then
909909 redistributed.wrapper
@@ -1991,6 +1991,7 @@ defaultTextBoxStyle =
19911991 , Border.width 1
19921992 , Element.spacing 3
19931993 , Element.width Element.fill
1994+ , Element.height Element.shrink
19941995 ]
19951996
19961997
src/Internal/Model.elm+2−1
@@ -2758,8 +2758,9 @@ toStyleSheetString options stylesheet =
27582758 ]
27592759 , renderStyle
27602760 maybePseudo
2761− ("textarea" ++ class)
2761+ ("textarea" ++ any ++ class)
27622762 [ Property "line-height" ("calc(1em + " ++ String.fromInt y ++ "px)")
2763+ , Property "height" ("calc(100% + " ++ String.fromInt y ++ "px)")
27632764 ]
27642765
27652766 -- , renderStyle
src/Internal/Style.elm+13
@@ -252,6 +252,7 @@ classes =
252252 -- inputText
253253 , inputText = "it"
254254 , inputMultiline = "iml"
255+ , inputMultilineParent = "imlp"
255256 }
256257
257258
@@ -1528,8 +1529,20 @@ baseSheet =
15281529 ]
15291530 , Descriptor (dot classes.inputMultiline)
15301531 [ 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"
15311543 , Descriptor (dot classes.paragraph)
15321544 [ Prop "white-space" "pre-wrap"
1545+ , Prop "color" "transparent"
15331546 ]
15341547 ]
15351548 , Descriptor (dot classes.paragraph)