From 2b755231626f0214842f9d9326500fc38d5d00e7 Mon Sep 17 00:00:00 2001 From: Craig Lyons Date: Sun, 13 Jan 2019 09:46:38 -0500 Subject: [PATCH] Wrap example form inputs in a span for compatibility with password managemer browser extensions --- book/architecture/forms.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/book/architecture/forms.md b/book/architecture/forms.md index ae2555db..34b70ec5 100644 --- a/book/architecture/forms.md +++ b/book/architecture/forms.md @@ -78,7 +78,7 @@ view model = viewInput : String -> String -> String -> (String -> msg) -> Html msg viewInput t p v toMsg = - input [ type_ t, placeholder p, value v, onInput toMsg ] [] + span [] [ input [ type_ t, placeholder p, value v, onInput toMsg ] [] ] viewValidation : Model -> Html msg @@ -144,10 +144,11 @@ We start by creating a `
` with four child nodes. But instead of using funct ```elm viewInput : String -> String -> String -> (String -> msg) -> Html msg viewInput t p v toMsg = - input [ type_ t, placeholder p, value v, onInput toMsg ] [] + span [] [ input [ type_ t, placeholder p, value v, onInput toMsg ] [] ] ``` -So `viewInput "text" "Name" model.name Name` can create a node like ``. That node will also send messages like `Name "Billy"` to `update` on user input. +So `viewInput "text" "Name" model.name Name` can create a node like ``. That node will also send messages like `Name "Billy"` to `update` on user input. +(We wrap it in a span for compatibility with popular browser extensions, such as password managers.) The fourth entry is more interesting. It is a call to `viewValidation`: