-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Toggletip: Add support to programmatically close it #75846
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.
LGTM
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.
don't think we would want to do this via an effect. have started a discussion in slack to figure out the best way of handling 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.
so looking at the documentation for toggletip i think we'd recommend against putting this kind of stuff in a Toggletip
altogether and probably recommend a Modal
instead. one of the main don'ts for Toggletip
is:
Do not use to surface actions to users
if we were to add something like this, which i think does have value, i think we'd want to do it in the form of a show
prop similar to Tooltip
whereby you manually handle the visible state outside of the Toggletip
component.
This seems like a misuse of the |
If we are to use this component with forms inside it's a popover and we should use the popover background (primary) like all our other popovers |
For popover reference, TimeRangePicker, ColorPickerPopover can't think of others right now. |
After discussing with @ivanortegaalba, this use case makes sense for the toggletip. We'll look to create a generic popover component in the future to help with use-cases like this and align with the proper background color and as the other popovers use. |
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.
if we were to add something like this, which i think does have value, i think we'd want to do it in the form of a
show
prop similar toTooltip
whereby you manually handle the visible state outside of theToggletip
component.
this comment still applies ☝️
Agree! I can apply that feedback if that's ok @adela-almasan |
I pushed an update with the new prop @ashharrison90. It should be fine now |
ebb4d50
to
5dc136a
Compare
5dc136a
to
33b5271
Compare
@ashharrison90 given recent changes / addressing the |
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.
lgtm 👍
are we changing the design (background) in a follow-up PR? |
@torkelo yes - first step here #76069. I've just added a "custom" theme with the styling we want (primary background) - I think it's less invasive than allowing custom styling and I'm not sure if that's something we want to support right now. cc @ashharrison90 |
As part of the WIP DashGPT project, we needed to be able to close the
Toggletip
after clicking a button. I've added some changes to reflect that functionality, I'd appreciate feedback. Being optional, I don't believe the change should be disruptive of the current functionality.Extracted from #75204
toggletip.mov
Special notes for your reviewer:
Please check that: