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
ee62428Matthew Griffith
src/Element/Input.elm+11−2
@@ -957,7 +957,11 @@ textHelper textInput attrs textOptions =
957 identity
957 identity
958 )
958 )
959 [ Element.width Element.fill
959 [ Element.width Element.fill
960+ , if List.any hasFocusStyle withDefaults then
961+ Internal.NoAttribute
962+
963+ else
960− , Internal.htmlClass classes.focusedWithin
964+ Internal.htmlClass classes.focusedWithin
961 , Internal.htmlClass classes.inputMultilineWrapper
965 , Internal.htmlClass classes.inputMultilineWrapper
962 ]
966 ]
963 ++ redistributed.parent
967 ++ redistributed.parent
@@ -1005,7 +1009,12 @@ textHelper textInput attrs textOptions =
1005 Internal.asEl
1009 Internal.asEl
1006 Internal.div
1010 Internal.div
1007 (Element.width Element.fill
1011 (Element.width Element.fill
1012+ :: (if List.any hasFocusStyle withDefaults then
1013+ Internal.NoAttribute
1014+
1015+ else
1008− :: Internal.htmlClass classes.focusedWithin
1016+ Internal.htmlClass classes.focusedWithin
1017+ )
1009 :: List.concat
1018 :: List.concat
1010 [ redistributed.parent
1019 [ redistributed.parent
1011 , case textOptions.placeholder of
1020 , case textOptions.placeholder of
src/Internal/Model.elm+4
@@ -2660,6 +2660,10 @@ renderStyle options maybePseudo selector props =
2660 ++ "-fs {"
2660 ++ "-fs {"
2661 ++ renderedProps
2661 ++ renderedProps
2662 ++ "\n}"
2662 ++ "\n}"
2663+ , selector
2664+ ++ "-fs:focus-within {"
2665+ ++ renderedProps
2666+ ++ "\n}"
2663 , ".focusable-parent:focus ~ "
2667 , ".focusable-parent:focus ~ "
2664 ++ "."
2668 ++ "."
2665 ++ classes.any
2669 ++ classes.any