mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-11-25 19:15:09 +03:00
resolves #61 - While chrome has a minimum line-height of 1.05em on text inputs, which was making the math be slightly off forcomparison to normal els
, we can come back to sanity by setting height as well as line-height
This commit is contained in:
parent
ec1f303a24
commit
37bd5b70ef
@ -863,9 +863,7 @@ textHelper textInput attrs textOptions =
|
||||
++ (case textInput.type_ of
|
||||
TextInputNode inputType ->
|
||||
[ Internal.Attr (Html.Attributes.type_ inputType)
|
||||
, Internal.htmlClass (classes.inputText ++ " " ++ classes.inputMultiline)
|
||||
|
||||
-- , Internal.htmlClass "focusable"
|
||||
, Internal.htmlClass classes.inputText
|
||||
]
|
||||
|
||||
TextArea ->
|
||||
@ -1179,11 +1177,18 @@ redistributeOver isMultiline stacked attr els =
|
||||
|
||||
else
|
||||
let
|
||||
newHeight =
|
||||
Element.htmlAttribute
|
||||
(Html.Attributes.style
|
||||
"height"
|
||||
("calc(1.0em + " ++ String.fromInt (2 * min t b) ++ "px)")
|
||||
)
|
||||
|
||||
newLineHeight =
|
||||
Element.htmlAttribute
|
||||
(Html.Attributes.style
|
||||
"line-height"
|
||||
("calc(1.05em + " ++ String.fromInt (2 * min t b) ++ "px)")
|
||||
("calc(1.0em + " ++ String.fromInt (2 * min t b) ++ "px)")
|
||||
)
|
||||
|
||||
reducedVerticalPadding =
|
||||
@ -1196,7 +1201,7 @@ redistributeOver isMultiline stacked attr els =
|
||||
in
|
||||
{ els
|
||||
| parent = reducedVerticalPadding :: els.parent
|
||||
, input = newLineHeight :: els.input
|
||||
, input = newHeight :: newLineHeight :: els.input
|
||||
, cover = attr :: els.cover
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user