Apparently, Halogen lacks "dialog" value of method attribute. As of writing the words, the method attribute in Halogen has only get and post values.
The good news though is Halogen says that when this happens it's not a problem as these may be added by a user.
So that's exactly what I'm trying to do here, but the code fails with error and I don't exactly see how to work around it:
module Main where
import Prelude
import Effect (Effect)
import Halogen (PropName(..))
import Halogen as H
import Halogen.Aff as HA
import Halogen.Aff (awaitBody, runHalogenAff)
import Halogen.HTML (prop)
import Halogen.HTML as HH
import Halogen.HTML.Properties (IProp)
import Halogen.HTML.Properties as HP
import Halogen.VDom.Driver (runUI)
main :: Effect Unit
main = HA.runHalogenAff do
body <- HA.awaitBody
runUI component unit body
component :: ∀ query input output m. H.Component query input output m
component =
H.mkComponent { initialState: const 0, render, eval: H.mkEval H.defaultEval}
where
render _ = HH.div_
[ HH.dialog [HP.style "padding: 0"]
[HH.form [HP.style "padding: 1rem", method "dialog"] []]
]
where
method :: forall r i. String -> IProp (method :: String | r) i
method = prop (PropName "method")
error:
Error found:
in module Main
at src/Main.purs:27:54 - 27:69 (line 27, column 54 - line 27, column 69)
Could not match type
String
with type
FormMethod
while matching label method
I also tried creating a HH.attr (AttrName "method") "dialog" but it doesn't seem to work.