Skip to content

Commit 20b95b4

Browse files
committed
Fix for onClick
1 parent 394c1b6 commit 20b95b4

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/react-notification.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ export default class ReactNotification extends React.Component {
120120
}
121121

122122
onClick() {
123-
this.removeNotification(REMOVAL.CLICK);
123+
const { notification: { dismiss } } = this.props;
124+
if (dismiss.click || dismiss.showIcon) {
125+
this.removeNotification(REMOVAL.CLICK);
126+
}
124127
}
125128

126129
onTouchStart({ touches }) {
@@ -314,7 +317,7 @@ export default class ReactNotification extends React.Component {
314317
}
315318

316319
render() {
317-
const { notification: { content } } = this.props;
320+
const { notification: { content, dismiss: { click } } } = this.props;
318321
const {
319322
parentStyle,
320323
onAnimationEnd,
@@ -325,7 +328,7 @@ export default class ReactNotification extends React.Component {
325328
return (
326329
<div
327330
ref={this.rootElementRef}
328-
onClick={this.onClick}
331+
onClick={click ? this.onClick : null}
329332
className='n-parent'
330333
style={parentStyle}
331334
onAnimationEnd={onAnimationEnd}

0 commit comments

Comments
 (0)