ensure correct textarea height within Input.multiline

This commit is contained in:
Matthew Griffith 2019-07-02 08:46:19 -04:00
parent dc1f301c60
commit 5b6647b443
3 changed files with 19 additions and 4 deletions

View File

@ -872,7 +872,6 @@ textHelper textInput attrs textOptions =
[ Element.clip
, Element.height Element.fill
, Internal.htmlClass classes.inputMultiline
, Element.alpha 0.3
, moveUpToCompensateForPadding
]
)
@ -890,7 +889,8 @@ textHelper textInput attrs textOptions =
Internal.asEl
Internal.div
([ Element.width Element.fill
, Element.height (Element.px 100)
-- , Element.height (Element.px 100)
, Element.scrollbarY
, Internal.htmlClass classes.focusedWithin
]
@ -903,7 +903,7 @@ textHelper textInput attrs textOptions =
(Element.width Element.fill
:: Element.height Element.fill
:: Element.inFront inputElement
:: Internal.htmlClass classes.inputMultiline
:: Internal.htmlClass classes.inputMultilineParent
:: List.concat
[ if heightContent then
redistributed.wrapper
@ -1991,6 +1991,7 @@ defaultTextBoxStyle =
, Border.width 1
, Element.spacing 3
, Element.width Element.fill
, Element.height Element.shrink
]

View File

@ -2758,8 +2758,9 @@ toStyleSheetString options stylesheet =
]
, renderStyle
maybePseudo
("textarea" ++ class)
("textarea" ++ any ++ class)
[ Property "line-height" ("calc(1em + " ++ String.fromInt y ++ "px)")
, Property "height" ("calc(100% + " ++ String.fromInt y ++ "px)")
]
-- , renderStyle

View File

@ -252,6 +252,7 @@ classes =
-- inputText
, inputText = "it"
, inputMultiline = "iml"
, inputMultilineParent = "imlp"
}
@ -1528,8 +1529,20 @@ baseSheet =
]
, Descriptor (dot classes.inputMultiline)
[ Prop "white-space" "pre-wrap"
, Prop "height" "100%"
, Prop "width" "100%"
-- , Prop "color" "transparent"
, Prop "background-color" "transparent"
-- , Prop "caret-color" "black"
]
, Descriptor (dot classes.inputMultilineParent)
[ Prop "white-space" "pre-wrap"
, Prop "cursor" "text"
, Descriptor (dot classes.paragraph)
[ Prop "white-space" "pre-wrap"
, Prop "color" "transparent"
]
]
, Descriptor (dot classes.paragraph)