-
Notifications
You must be signed in to change notification settings - Fork 14
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
Clicking outside closes Quarter and Add Year Popovers #406
Conversation
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.
The showQuarterMenu
and show
states can be removed since the overlaytrigger now handles that functionality and they're not doing anything.
The popovers do not close when you click a button within them. Previously clicking add year would close the popover. Clicking clear wouldn't close the popover for a quarter but I think it should. A quick hack for this is adding document.documentElement.click()
to the onClick handlers for these buttons.
Looks like there are a couple merge conflicts after merging my dark mode PR. The only conflicting changes I made were adding a class name to the add year form and using the current theme to determine the button variant for the quarter popover menus. Make sure to implement those on top of your current changes when merging changes from master and you should be fine. |
Good catch. I did call the event to close it when you click "delete", but forgot to do it for "clear" |
Accepted suggestion from #406 (comment) Co-authored-by: Jacob Sommer <[email protected]>
This isn't completely true. I am using the Additionally, I would rather set state based on the event that's already being fired instead of doing a hack like manually click root to close it. |
so that clicking add year closes the popup
Deployed staging instance to https://staging-406.peterportal.org |
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.
🚀
Description
Uses an
OverlayTrigger
around the buttons that create a popover, which allows React Bootstrap to handle the toggle events for these menus.Note: This PR does NOT cover the Edit Year popover, as I believe that should be reworked to not include nested menus. Currently, using an OverlayTrigger will close the Year overlay when you click on the input in the Edit Year form because it is outside of the Year overlay.
We could use a custom handler of some sort to determine when to close the overlay trigger, but that's not any better than the what we had before with the Overlays and their handlers, so I'll hold off on changing this.
(Clicking the "name" or "start year" fields causes the Overlay Trigger to close)
Screenshots
Clicking outside of these will close them
Steps to verify/test this change:
Final Checks:
Issues
Partially fixes issue #167