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
Greatly improve the tooltip component #3987
Conversation
ABA-226 Fix Tooltip
There are multiple issues with it:
|
097305e
to
23d1220
Compare
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 don't love adding more dependencies, but it might be worth it in this case. It works significantly better than before, and the code is way simpler. Looks great!
I think it might be worth keeping the possibility to override the popover position though, f.ex. on the event attendees I think it looks better with the popover over the profile picture.
23d1220
to
8ff56e3
Compare
It is now no longer super buggy! Firstly it will not overflow out of view when there is no space. Through the `popper` library, it will find the most suitable postion. No more need for the `renderDirection` prop and hacky calculations. Another nice feature is that it will point to the right direction even when the trigger component is flexed, which it often is. This is most noticeable on tables. Some minor styling changes as well, but that's not really the important part of this change. Worth noting that there is no longer an annoying buggy line between the arrow and the tooltip whenever there's a bad render.
8ff56e3
to
0bccb78
Compare
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.
Looks good!
Description
It is now no longer super buggy!
Firstly it will not overflow out of view when there is no space.
Through the
popper
library, it will find the most suitable postion.No more need for the
renderDirection
prop and hacky calculations.Another nice feature is that it will point to the right direction even
when the trigger component is flexed, which it often is. This is most
noticeable on tables.
Some minor styling changes as well, but that's not really the important
part of this change. Worth noting that there is no longer an annoying
buggy line between the arrow and the tooltip whenever there's a bad
render.
Result
Screen.Recording.2023-06-09.at.18.33.37.mov
Testing
Went through all uses of tooltips. Tried all viewports, hard refreshes and other "stress testing".
Resolves webkom/lego#2849