Skip to content

Commit

Permalink
[Added] close modal on right click
Browse files Browse the repository at this point in the history
  • Loading branch information
ZainGulbaz committed Aug 28, 2022
1 parent a16949b commit 06c1c04
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,12 @@ export default class ModalPortal extends Component {
this.shouldClose = null;
};

handleOverlayRightClick = (event) => {
if (this.shouldClose === null) this.shouldClose = true;
else if (!this.shouldClose) this.shouldClose = null;
if (this.shouldClose) {
event.preventDefault();
this.props.onOverlayRightClick(event);
}
handleOverlayRightClick = event => {
if(event.target == this.overlay)
{
event.preventDefault();
this.props.onOverlayRightClick(event);
}
};

handleContentOnMouseUp = () => {
Expand Down

0 comments on commit 06c1c04

Please sign in to comment.