thomashoneyman / purescript-halogen-formless

Forms for Halogen

Home Page:https://thomashoneyman.github.io/purescript-halogen-formless

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update example components to use `submitPreventDefault`

chiroptical opened this issue · comments

In #80, @gillchristian and I added the ability to use a more idiomatic form and prevent the default event when using onSubmit. It would be awesome to update the examples/readme to match the more idiomatic style in the readme example.

Formless 3 now provides you with a handleSubmit function that can be used to handle submission events on your form (including calling preventDefault for you), and a separate submit function that can be used to imperatively submit the form without access to an event.

See the basic example:

[ HE.onSubmit formActions.handleSubmit ]