Skip to content

Commit b97f778

Browse files
committed
Use HTMLElement
1 parent ff530bb commit b97f778

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

src/Example/TodoForm.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/Example/TodoForm.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ import Effect (Effect)
99
import React as React
1010
import React.Hook (Hook)
1111
import React.Hook as Hook
12-
import React.Ref (Ref, DOMRef)
1312
import React.Ref as Ref
1413
import React.SyntheticEvent as Event
1514
import React.DOM as DOM
1615
import React.DOM.Props as Props
1716

17+
import Web.HTML.HTMLElement as HTML
18+
1819
import Unsafe.Coerce (unsafeCoerce)
1920

2021
import Example.TodoContext as TodoContext
@@ -74,7 +75,7 @@ todoForm
7475

7576
domRef <- Ref.getRef ref
7677

77-
maybe (pure unit) blur domRef
78+
maybe (pure unit) (HTML.blur <<< unsafeCoerce) domRef
7879

7980
pure unit
8081

@@ -84,5 +85,3 @@ todoForm
8485
todo
8586
where
8687
text = (unsafeCoerce event).target.value
87-
88-
foreign import blur :: DOMRef -> Effect Unit

0 commit comments

Comments
 (0)