git.iko.soy/rowtype-yoga/purescript-yoga-react-dom
on main help sign in
Add onSubmit and onChange event handlers

The 'onSubmit' event handler has been added to FormAttributes in the Form.purs file, while the 'onChange' event handler has been added to InputAttributes in the Input.purs file. These changes allow us to assign callback functions for form submission and input change events, enhancing the interactivity of forms in our application.

commita63928d39fff3b1d33e6d86e9bb898906c201689 authorMark Eibes <mark.eibes@gmail.com> dateSun 6 Aug 2023, 21:21 (3 years ago) parenta34fd57
2 files changed+4
src/Beta/DOM/HTML/Form.purs+2 src/Beta/DOM/HTML/Input.purs+2
src/Beta/DOM/HTML/Form.purs+2
@@ -4,6 +4,7 @@ import Prelude
44
55import Beta.DOM.Attributes (BaseAttributesR)
66import Beta.DOM.Internal (FFIComponent, createBuiltinElement)
7+import React.Basic.Events (EventHandler)
78
89-- | The `<form>` HTML element represents a form, which is a component of an application
910-- | that is designed for the performing of an action by the user.
@@ -22,4 +23,5 @@ form = createBuiltinElement "form"
2223type FormAttributes = BaseAttributesR
2324 ( action :: String
2425 , method :: String
26+ , onSubmit :: EventHandler
2527 )
src/Beta/DOM/HTML/Input.purs+2
@@ -4,6 +4,7 @@ import Prelude
44
55import Beta.DOM.Attributes (BaseAttributesR)
66import Beta.DOM.Internal (FFIComponent_, createBuiltinElement_)
7+import React.Basic.Events (EventHandler)
78
89-- | The `<input>` HTML element represents a field for user input.
910-- |
@@ -40,5 +41,6 @@ type InputAttributes = BaseAttributesR
4041 , accept :: String
4142 , autocomplete :: String
4243 , form :: String
44+ , onChange :: EventHandler
4345 )
4446