-
Notifications
You must be signed in to change notification settings - Fork 810
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
[Added] Modal Close on right click at overlay #963
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,12 @@ import ReactModal from 'react-modal'; | |
/* Function that will be run when the modal is requested | ||
to be closed (either by clicking on overlay or pressing ESC). | ||
Note: It is not called if isOpen is changed by other means. */} | ||
|
||
onOverlayRightClick={ | ||
handleRequestCloseFunc | ||
/* Function that will be run when the modal is requested | ||
to be closed (either by right clicking on overlay or pressing ESC). | ||
Note: It is not called if isOpen is changed by other means. */} | ||
Comment on lines
+58
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is out of date given that 06c1c04 changed the prop to be a pass-through to I would suggest a straightforward comment like:
|
||
|
||
closeTimeoutMS={ | ||
0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would propose
onOverlayContextMenu
as a better name for this prop, per @diasbruno's suggestion here.We are passing this to React's
onContextMenu
event handler, which maps to thecontextmenu
event (see MDN docs):Some alternate ways to trigger the
contextmenu
event beyond right click:ctrl
+ click on MacOSshift+f10
on Windowsfn+12
on MacOS (with "Alternate Pointer Events" enabled)...And some screen readers have their own triggers, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that if we do decide to rename the prop, it may be worth updating the commits/PR title so that the wording in the changelog is accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one I didn't know. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, agree. Better to keep the names consistent.