-
Notifications
You must be signed in to change notification settings - Fork 55
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(components): tooltips #2413
Conversation
2 similar comments
}), | ||
)} | ||
|
||
{visible && | ||
ReactDOM.createPortal( | ||
<div className={theme['tc-tooltip-container']} style={style}> | ||
<div className={theme['tc-tooltip-container']} style={getTooltipPosition().style}> |
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.
we can use placement, style declared above
output/components.eslint.txt
Outdated
@@ -42,13 +42,21 @@ The react/require-extension rule is deprecated. Please use the import/extensions | |||
/home/travis/build/Talend/ui/packages/components/src/SubHeaderBar/SubHeaderBar.test.js | |||
4:8 error 'Container' is defined but never used no-unused-vars | |||
|
|||
/home/travis/build/Talend/ui/packages/components/src/TooltipTrigger/TooltipTrigger.component.js | |||
193:10 error 'placement' is assigned a value but never used no-unused-vars |
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.
please fix the proptypes definition and remove them if not used
packages/components/src/TooltipTrigger/TooltipTrigger.component.js
Outdated
Show resolved
Hide resolved
packages/components/src/TooltipTrigger/TooltipTrigger.component.js
Outdated
Show resolved
Hide resolved
packages/components/src/TooltipTrigger/TooltipTrigger.component.js
Outdated
Show resolved
Hide resolved
1 similar comment
let dimensions; | ||
try { | ||
// eslint-disable-next-line react/no-find-dom-node | ||
dimensions = ReactDOM.findDOMNode(refContainer.current).getBoundingClientRect(); |
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.
Just a question about this change, I don't understand why you need to find your ref in the domnode, since the ref is normally a pointer to the domnode ?
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.
Because actually ref is not always referencing a DOM node, but just a pointer like you said, so there is no way to access to its getBoudingClientRect
method.
…ps' into frassinier/fix/components/tooltips
1 similar comment
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.
Thanks for fixs 👍
What is the problem this PR is trying to solve?
Tooltips can be shown twice at the same time
What is the chosen solution to this problem?
Use
React.Fragment
and better timeout managementPlease check if the PR fulfills these requirements
[ ] This PR introduces a breaking change