git.iko.soy/typeable/elm-ui
on master help sign in
resolves #138 - individual focus styles weren't being applied to text and multiline text input
commitee624284a28d869e9824b6e9290d738b6a32eaac authorMatthew Griffith <mdg.griffith@gmail.com> dateFri 9 Aug 2019, 23:20 (7 years ago) parent02e9919
2 files changed+15−2
src/Element/Input.elm+11−2 src/Internal/Model.elm+4
src/Element/Input.elm+11−2
@@ -957,7 +957,11 @@ textHelper textInput attrs textOptions =
957957 identity
958958 )
959959 [ Element.width Element.fill
960− , Internal.htmlClass classes.focusedWithin
960+ , if List.any hasFocusStyle withDefaults then
961+ Internal.NoAttribute
962+
963+ else
964+ Internal.htmlClass classes.focusedWithin
961965 , Internal.htmlClass classes.inputMultilineWrapper
962966 ]
963967 ++ redistributed.parent
@@ -1005,7 +1009,12 @@ textHelper textInput attrs textOptions =
10051009 Internal.asEl
10061010 Internal.div
10071011 (Element.width Element.fill
1008− :: Internal.htmlClass classes.focusedWithin
1012+ :: (if List.any hasFocusStyle withDefaults then
1013+ Internal.NoAttribute
1014+
1015+ else
1016+ Internal.htmlClass classes.focusedWithin
1017+ )
10091018 :: List.concat
10101019 [ redistributed.parent
10111020 , case textOptions.placeholder of
src/Internal/Model.elm+4
@@ -2660,6 +2660,10 @@ renderStyle options maybePseudo selector props =
26602660 ++ "-fs {"
26612661 ++ renderedProps
26622662 ++ "\n}"
2663+ , selector
2664+ ++ "-fs:focus-within {"
2665+ ++ renderedProps
2666+ ++ "\n}"
26632667 , ".focusable-parent:focus ~ "
26642668 ++ "."
26652669 ++ classes.any