-
-
Notifications
You must be signed in to change notification settings - Fork 236
Add close popup when click iframe for click trigger
#96
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
base: master
Are you sure you want to change the base?
Add close popup when click iframe for click trigger
#96
Conversation
Using Trigger with `contextMenu` supports closing on window blur, in order to cover when a user clicks/taps on an iframe, but when we use `click` as a trigger, this was previously not supported. This fix modifies the handler to support both click and contextMenu as valid triggers. * simulates document click on window blur for both click and contextMenu triggers * `contextMenuOutsideHandler1` renamed to `contextMenuScrollOutsideHandler` to be more descriptive about what case it is handling. * `contextMenuOutsideHandler2` renamed to `clickBlurOutsideHandler` since it is the handler for click and contextMenu triggers (similar to `clickOutsideHandler`)
| if (!this.contextMenuScrollOutsideHandler && this.isContextMenuToShow()) { | ||
| currentDocument = currentDocument || props.getDocument(); | ||
| this.contextMenuOutsideHandler1 = addEventListener(currentDocument, | ||
| this.contextMenuScrollOutsideHandler = addEventListener(currentDocument, |
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.
Sorry for delay. contextMenuScrollOutsideHandler should get remove after unmounted. And also need a test case for this.
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 also encountered this issue, could this PR get merged? |
|
how can we trigger this in an iframe? |
|
@zombieJ Can you please check on this. I have the same issue with iframe |
Using Trigger with
contextMenusupports closing on window blur, in order to cover when a user clicks/taps on an iframe, but when we useclickas a trigger, this was previously not supported.This fix modifies the handler to support both click and contextMenu as valid triggers.
contextMenuOutsideHandler1renamed tocontextMenuScrollOutsideHandlerto be more descriptive about what case it is handling.contextMenuOutsideHandler2renamed toclickBlurOutsideHandlersince it is the handler for click and contextMenu triggers (similar toclickOutsideHandler)