@@ -21,7 +21,6 @@ import Data.Tuple (Tuple(..), fst, snd)
21
21
import DOM (DOM )
22
22
import DOM.Event.EventTarget (eventListener ) as DOM
23
23
import DOM.Event.Types (EventType (..), Event ) as DOM
24
- import DOM.HTML.Types (HTMLElement ) as DOM
25
24
import DOM.Node.Types (Element ) as DOM
26
25
import Halogen.VDom as V
27
26
import Halogen.VDom.Types (Namespace (..))
@@ -32,7 +31,7 @@ data Prop a
32
31
= Attribute (Maybe Namespace ) String String
33
32
| Property String PropValue
34
33
| Handler DOM.EventType (DOM.Event → Maybe a )
35
- | Ref (ElemRef DOM.HTMLElement → Maybe a )
34
+ | Ref (ElemRef DOM.Element → Maybe a )
36
35
37
36
instance functorProp ∷ Functor Prop where
38
37
map f (Handler ty g) = Handler ty (map f <$> g)
@@ -91,7 +90,7 @@ buildProp emit el = render
91
90
done ps = do
92
91
case StrMap .lookup " ref" ps of
93
92
Just (Ref f) → do
94
- mbEmit (f (Removed (unsafeElementToHTMLElement el) ))
93
+ mbEmit (f (Removed el ))
95
94
_ → do
96
95
Util .effUnit
97
96
@@ -116,7 +115,7 @@ buildProp emit el = render
116
115
Fn .runFn3 Util .addEventListener ty listener el
117
116
pure v
118
117
Ref f → do
119
- mbEmit (f (Created (unsafeElementToHTMLElement el) ))
118
+ mbEmit (f (Created el ))
120
119
pure v
121
120
122
121
diffProp = Fn .mkFn2 \prevEvents events → Fn .mkFn4 \_ _ v1 v2 →
@@ -173,9 +172,6 @@ propToStrKey = case _ of
173
172
Handler (DOM.EventType ty) _ → " handler/" <> ty
174
173
Ref _ → " ref"
175
174
176
- unsafeElementToHTMLElement ∷ DOM.Element → DOM.HTMLElement
177
- unsafeElementToHTMLElement = unsafeCoerce
178
-
179
175
setProperty ∷ ∀ eff . Fn.Fn3 String PropValue DOM.Element (Eff (dom ∷ DOM | eff ) Unit )
180
176
setProperty = Util .unsafeSetAny
181
177
0 commit comments