Skip to content

Introduce preventDefault and stopPropagation. See #83. #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,13 @@ function createFactory(class_) {
return React.createFactory(class_);
}
exports.createFactory = createFactory;

function preventDefault(event) {
return function() { return event.preventDefault();}
};
exports.preventDefault = preventDefault;

function stopPropagation(event) {
return function() { return event.stopPropagation();}
};
exports.stopPropagation = stopPropagation;
6 changes: 6 additions & 0 deletions src/React.purs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module React
, transformState

, handle
, preventDefault
, stopPropagation

, createClass
, createClassStateless
Expand Down Expand Up @@ -362,3 +364,7 @@ foreign import data Children :: *

-- | Internal conversion function from children elements to an array of React elements
foreign import childrenToArray :: Children -> Array ReactElement

foreign import preventDefault :: forall eff a. Event -> Eff eff a

foreign import stopPropagation :: forall eff a. Event -> Eff eff a