File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ export const propagateThis = ( f ) => ( t ) => ( ) => {
4+ return f . call ( t ) ;
5+ }
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ nativeEvent = unsafeEventFn \e -> (unsafeCoerce e).nativeEvent
102102
103103preventDefault :: EventFn SyntheticEvent SyntheticEvent
104104preventDefault = unsafeEventFn \e -> unsafePerformEffect do
105- _ <- (unsafeCoerce e).preventDefault
105+ _ <- propagateThis (unsafeCoerce e).preventDefault e
106106 pure e
107107
108108isDefaultPrevented :: EventFn SyntheticEvent Boolean
@@ -111,7 +111,7 @@ isDefaultPrevented = unsafeEventFn \e -> unsafePerformEffect do
111111
112112stopPropagation :: EventFn SyntheticEvent SyntheticEvent
113113stopPropagation = unsafeEventFn \e -> unsafePerformEffect do
114- _ <- (unsafeCoerce e).stopPropagation
114+ _ <- propagateThis (unsafeCoerce e).stopPropagation e
115115 pure e
116116
117117isPropagationStopped :: EventFn SyntheticEvent Boolean
@@ -207,3 +207,5 @@ clipboardData = unsafeEventFn \e -> toMaybe (unsafeCoerce e).clipboardData
207207-- \ Composition Events
208208compositionData :: EventFn SyntheticEvent (Maybe String )
209209compositionData = unsafeEventFn \e -> toMaybe (unsafeCoerce e).data
210+
211+ foreign import propagateThis :: forall f t a . f -> t -> Effect a
You can’t perform that action at this time.
0 commit comments