Elm Html.Events - Pass input value to onBlur message

僤鯓⒐⒋嵵緔 提交于 2019-12-04 11:33:45

You can create a variation on the "blur" handler which pulls out target.value like this:

import Html.Events exposing (on, targetValue)
import Json.Decode as Json

onBlurWithTargetValue : (String -> msg) -> Attribute msg
onBlurWithTargetValue tagger =
    on "blur" (Json.map tagger targetValue)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!