Skip to content

preventDefault #65

Open
Open
@bilus

Description

@bilus

It would be useful to have this added to the library (great job BTW):

preventDefault :: P.ReactProps SyntheticInputEvent -> P.ReactProps SyntheticInputEvent
preventDefault = CP.handleProp $ liftEffect <<< SyntheticEvent.preventDefault

Usage example:

D.form [ SearchFormSubmitted <$ (preventDefault P.onSubmit) ]
  [ 
    -- Fields go here.
    SearchFormSubmitted <$ D.button [ P.onClick ] [ D.text "Search" ]
  ]

It's fantastic it wasn't there because I had no other choice but to understand what's under the hood but I think it's an useful addition. That plus an example of using handleProp. Just saying. :)

BTW. I had assumed Prop is a Monad; that threw me off a bit.

Thank you so much; I really enjoy using Concur!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions