Skip to content

Conversation

@maddie927
Copy link
Member

@maddie927 maddie927 commented Jul 3, 2018

Minor update

@maddie927 maddie927 self-assigned this Jul 3, 2018

exports.unsafeIsPropagationStopped = function(e) {
return e.isPropagationStopped();
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see comment below)

foreign import unsafePreventDefault :: SyntheticEvent -> SyntheticEvent
preventDefault = unsafeEventFn \e -> unsafePerformEffect do
_ <- (unsafeCoerce e).preventDefault
pure e
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized the FFI file here isn't actually necessary. Is this a bad idea for any reason (other than the unsafeCoerce -- the unsafePerformEffect is safe via EventFn)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(tested this as well -- there was actually a bug with isDefaultPrevented which this fixes)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be safe, yes.

Copy link
Contributor

@paf31 paf31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks great!

@maddie927 maddie927 merged commit db9b860 into master Jul 3, 2018
@maddie927 maddie927 deleted the michael/more-event-fns branch July 3, 2018 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants