git.iko.soy/typeable/elm-ui
on master help sign in
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
37bd5b7Matthew Griffith
src/Element/Input.elm+10−5
@@ -863,9 +863,7 @@ textHelper textInput attrs textOptions =
863 ++ (case textInput.type_ of
863 ++ (case textInput.type_ of
864 TextInputNode inputType ->
864 TextInputNode inputType ->
865 [ Internal.Attr (Html.Attributes.type_ inputType)
865 [ Internal.Attr (Html.Attributes.type_ inputType)
866− , Internal.htmlClass (classes.inputText ++ " " ++ classes.inputMultiline)
866+ , Internal.htmlClass classes.inputText
867−
868− -- , Internal.htmlClass "focusable"
869 ]
867 ]
870
868
871 TextArea ->
869 TextArea ->
@@ -1179,11 +1177,18 @@ redistributeOver isMultiline stacked attr els =
1179
1177
1180 else
1178 else
1181 let
1179 let
1180+ newHeight =
1181+ Element.htmlAttribute
1182+ (Html.Attributes.style
1183+ "height"
1184+ ("calc(1.0em + " ++ String.fromInt (2 * min t b) ++ "px)")
1185+ )
1186+
1182 newLineHeight =
1187 newLineHeight =
1183 Element.htmlAttribute
1188 Element.htmlAttribute
1184 (Html.Attributes.style
1189 (Html.Attributes.style
1185 "line-height"
1190 "line-height"
1186− ("calc(1.05em + " ++ String.fromInt (2 * min t b) ++ "px)")
1191+ ("calc(1.0em + " ++ String.fromInt (2 * min t b) ++ "px)")
1187 )
1192 )
1188
1193
1189 reducedVerticalPadding =
1194 reducedVerticalPadding =
@@ -1196,7 +1201,7 @@ redistributeOver isMultiline stacked attr els =
1196 in
1201 in
1197 { els
1202 { els
1198 | parent = reducedVerticalPadding :: els.parent
1203 | parent = reducedVerticalPadding :: els.parent
1199− , input = newLineHeight :: els.input
1204+ , input = newHeight :: newLineHeight :: els.input
1200 , cover = attr :: els.cover
1205 , cover = attr :: els.cover
1201 }
1206 }
1202
1207