-
Notifications
You must be signed in to change notification settings - Fork 21
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
New tooltip + making the DropdownTrigger be a Button #276
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.
Tested it again and it works nicely everywhere now.
One thing regarding this though:
delays: not recommended for tooltips
Looking at the recent discussions in Twist about tooltips it seems like we need some delay. Especially, for the macOS app ref. Do you think we can solve that with a delayed css animation? Or should this component have real delay support?
I don't think this is blocking for this PR though, we could add it as a feature later on 👍
(And sorry for not bringing it up earlier).
I'll explore the animation thing and see if it allows us to introduce a certain small delay. Though the tooltip accessibility recommendations do not say anything about delaying things, but they also are not explicit about immediacy (ref). |
Achieved the tooltip delay (reakit is so sweet in giving us so much power in customizing it), and I agree that a very small delay is beneficial. Especially the fact that without it if you pass the mouse cursor over an element with a tooltip even very rapidly, the tooltip flashes on and off, while what every one would want is to not appear in that case. reach-ui got that one right, but it was harder to customize the delay they have (too long when you leave the element) than in reakit, where it was relatively easy without any patching. Thanks for pushing for this. Much better now. I still left it as not something we allow to customize for the moment but we can revisit and discuss that decision. |
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!
Short description
This PR introduces a new tooltip, and it makes small but breaking changes to the dropdown trigger and the popover.
There will be an accompanying PR in Twist to adopt all these changes. It is in the works.
About the new tooltip
The new tooltip is internally implemented using reakit's Tooltip. It has less customization options. Most of what was dropped has a reason:
not recommended for tooltips(these were brought back during this PR but they are no longer customizable, which is IMO a good thing though we may revisit that in the future)The new tooltip introduces another restriction over the previous one: it has to be wrapping a single element, not many elements. This makes sense anyway, as it is on focus and hover when it shows up.
About the changes to popover and dropdown trigger
These are introducing the same restrictions on the trigger to be a single element. We no longer can set a dropdown or popover trigger to be various elements.
In addition to that, the
Dropdown.Trigger
is now aButton
and it supports receiving atooltip="..."
prop directly. I now realize I could've enabled it to receive some of the other customization options of theButton
(variant
,size
) but I can do that later. Probably it won't be needed as we'll have a new dropdown menu replacing most of its uses.PR Checklist
npm run validate
and made sure no errors / warnings were shownCHANGELOG.md
package.json
npm run build-all
)Versioning
These are significan breaking changes and will require a new major release. I may coordinate it to include another major change that is coming (the new and accessible dropdown menu component).