Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preventDefault #65

Open
bilus opened this issue Sep 15, 2023 · 0 comments
Open

preventDefault #65

bilus opened this issue Sep 15, 2023 · 0 comments

Comments

@bilus
Copy link

bilus commented Sep 15, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant