Skip to content

Commit 3cf32f0

Browse files
authored
Merge pull request #84 from teh/master
Introduce preventDefault and stopPropagation. See #83.
2 parents 7de839d + ea0df6e commit 3cf32f0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/React.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,13 @@ function createFactory(class_) {
152152
return React.createFactory(class_);
153153
}
154154
exports.createFactory = createFactory;
155+
156+
function preventDefault(event) {
157+
return function() { return event.preventDefault();}
158+
};
159+
exports.preventDefault = preventDefault;
160+
161+
function stopPropagation(event) {
162+
return function() { return event.stopPropagation();}
163+
};
164+
exports.stopPropagation = stopPropagation;

src/React.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ module React
5151
, transformState
5252

5353
, handle
54+
, preventDefault
55+
, stopPropagation
5456

5557
, createClass
5658
, createClassStateless
@@ -362,3 +364,7 @@ foreign import data Children :: *
362364

363365
-- | Internal conversion function from children elements to an array of React elements
364366
foreign import childrenToArray :: Children -> Array ReactElement
367+
368+
foreign import preventDefault :: forall eff a. Event -> Eff eff a
369+
370+
foreign import stopPropagation :: forall eff a. Event -> Eff eff a

0 commit comments

Comments
 (0)