Skip to content

Commit

Permalink
fix(backdrop-click): Prevent click element under backdrop because of …
Browse files Browse the repository at this point in the history
…propagation

#20
  • Loading branch information
Simon Mollweide committed Oct 27, 2017
1 parent ac1fa21 commit 0ddd5e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/node_modules/
/public/
/coverage/
/build/
9 changes: 7 additions & 2 deletions src/components/speed-dial/speed-dial.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@ class SpeedDial extends React.Component {
}

/**
* @param {Event} event - the click event object
* @returns {void}
*/
handleClickBackdrop() {
handleClickBackdrop(event) {
if (event && typeof event.stopPropagation === 'function') {
event.stopPropagation();
}

/* istanbul ignore next */
this.updateState({
isOpen: false,
Expand Down Expand Up @@ -260,7 +265,7 @@ class SpeedDial extends React.Component {
return;
}

this.handleClickBackdrop();
this.handleClickBackdrop(event);
}

/**
Expand Down

0 comments on commit 0ddd5e4

Please sign in to comment.