@@ -11,6 +11,7 @@ import Reflex.Host.Class
1111import Data.Map (Map)
1212import GHCJS.DOM.Document
1313import GHCJS.DOM.HTMLInputElement
14+import GHCJS.DOM.HTMLTextAreaElement
1415import GHCJS.DOM.Node
1516import GHCJS.DOM.Element
1617import GHCJS.DOM.HTMLSelectElement
@@ -106,6 +107,18 @@ textInput = input' "text" "" never (constDyn $ Map.empty)
106107textInputGetEnter :: Reflex t => TextInput t -> Event t ()
107108textInputGetEnter i = fmapMaybe (\n -> if n == keycodeEnter then Just () else Nothing) $ _textInput_keypress i
108109
110+data TextArea t
111+ = TextArea { _textArea_value :: Dynamic t String
112+ , _textArea_element :: HTMLTextAreaElement
113+ }
114+
115+textArea :: MonadWidget t m => String -> Event t String -> Map String String -> m (TextArea t)
116+textArea initial eSet attrs = do
117+ e <- liftM castToHTMLTextAreaElement $ buildEmptyElement "textarea" attrs
118+ ev <- wrapDomEvent e elementOninput $ liftIO $ htmlTextAreaElementGetValue e
119+ v <- holdDyn "" ev
120+ return $ TextArea v e
121+
109122{-
110123type family Controller sm t a where
111124 Controller Edit t a = (a, Event t a) -- Initial value and setter