-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feat/tooltip #1088
Feat/tooltip #1088
Conversation
Hey @brunohkbx, thank you for your pull request 🤗. The documentation from this branch can be viewed here. Please remember to update Typescript types if you changed API. |
Any update on this? |
@andresmtz98 I'm waiting for @Trancever's review. |
@brunohkbx I resolved all the conflicts + added support for typescript locally but I can't push it, because you created PR from your fork. I am pretty sure you have a write access, so please use main repo instead of fork next time :D Could you open new PR from |
I didn't realize that I was working from the forked repository. 😞 |
Motivation
Add component Tooltip
Description
In this section, I'm going to highlight some key points of the implementation that I'm not sure if it's ok.
I had to pass a prop
onLongPress
on L242 to prevent the children's touchable to respond to anonPress
event right after the end ofonLongPress
I don't know why but I had to use a setTimeout with 500 ms to properly compute the Y position of the children on L126. It will get random values for Y without this setTimeout or with a smaller value.
I've found the same problem on this implementation: https://github.com/react-native-training/react-native-elements/blob/master/src/tooltip/Tooltip.js#L145 and it's somehow related to measureInWindow returns an incorrect Y coord on Android facebook/react-native#19497
The tooltip starts with
opacity: 0
and then it changes to0.9
when its measure gets calculated at L132. Should I have used animation to change this value?TODOs
Fix tooltip coords when orientation change- 8ea66a8onLayout doesn't trigger on children component when the orientation changes, so I had to remove it.
Fix flow- b7bd00dTest on IOS- It works!! 😃Add normal and tsx tests- b50faddAdd docs- 8875998Material Design specs
Don't crop Tooltip on the left side
![left](https://user-images.githubusercontent.com/6487206/58302499-c8a61b00-7dc1-11e9-99ec-b46097415d30.jpeg)
Don't crop Tooltip on the right side
![right](https://user-images.githubusercontent.com/6487206/58303473-a1058180-7dc6-11e9-8b8f-c78cd8bf803a.jpeg)
Don't crop Tooltip on the bottom
![bottom](https://user-images.githubusercontent.com/6487206/58302530-f1c6ab80-7dc1-11e9-8b07-089055991a83.jpeg)
Landscape mode
![landscape](https://user-images.githubusercontent.com/6487206/58346044-40ab2a00-7e30-11e9-89b9-d4c3b6074e17.jpeg)
Test plan
Appbar
orToggle Button
section and hold press on any icon with Tooltip.References
Screenshots