-
Notifications
You must be signed in to change notification settings - Fork 715
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
Fix tooltip with bounds #721
Conversation
@williaster What do you think about adding a warning when a user passes both the |
@dennisja sorry for the delay. We don't have a precedent anywhere in |
@@ -1,7 +1,25 @@ | |||
import { TooltipWithBounds } from '../src'; | |||
import React from 'react'; | |||
import { mount } from 'enzyme'; |
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.
ideally we would use shallow
over mount
, is that possible?
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.
For some reason using shallow
fails. I first suspected the fact that TooltipWithBounds
is wrapped by a higher-order component that uses life cycle methods to be the reason but even when I use shallow
and enable life cycle methods it still fails.
I have seen an issue pointing out that it might be a problem with HOCs but I'm tired now. I Will read through it tomorrow and see whether I can switch mount to shallow. Its been long ever since I used Enzyme
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.
@williaster I found a workaround to use shallow
over mount
. Let me know what you think about it
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.
this is perfect! yeah usually you have to use .dive()
to traverse as needed to whatever selection you are looking for. Thanks for making the change! 🙏
Great work @dennisja , thanks for the bug fix + enhancement! |
💥 Breaking Changes
🚀 Enhancements
📝 Documentation
🐛 Bug Fix
unstyled
prop is passed toTooltipWithBounds
🏠 Internal
Fixes #691