set pui-react-tooltip width so div is centered around triggering element#15542
Merged
nreese merged 1 commit intoelastic:masterfrom Dec 13, 2017
Merged
set pui-react-tooltip width so div is centered around triggering element#15542nreese merged 1 commit intoelastic:masterfrom
nreese merged 1 commit intoelastic:masterfrom
Conversation
cjcenizal
approved these changes
Dec 12, 2017
Contributor
cjcenizal
left a comment
There was a problem hiding this comment.
Nice fix! How did you figure this out?
I dug into pui-tooltip a bit. It looks like they use a React wrapper around tether.js, which is responsible for positioning. (Interestingly, the Tether maintainers now suggest people use popper.js, which we should consider when we build our tooltip).
I wasn't able to figure out why this bug occurs, but I do have some clues:
- PUI uses
unstable_renderSubtreeIntoContainer, but React 16 recommends switching toReactDOM.createPortal. - There have been numerous issues reported with
renderSubtreeIntoContainer: facebook/react#9808, facebook/react#10310, facebook/react#10309. - Maybe it has something to do with the element being rendered after Tether is instantiated or updated?
nreese
added a commit
to nreese/kibana
that referenced
this pull request
Dec 13, 2017
nreese
added a commit
that referenced
this pull request
Dec 13, 2017
nyurik
pushed a commit
to nyurik/kibana
that referenced
this pull request
Dec 15, 2017
w33ble
added a commit
to w33ble/kibana
that referenced
this pull request
Apr 5, 2018
elastic#15542)" This reverts commit c06b445.
w33ble
added a commit
to w33ble/kibana
that referenced
this pull request
Sep 13, 2018
* fix: hacky style override for .tooltip introduced upstream in elastic#15542, which causes any .tooltip element to have a fixed width of 1px * fix: revert 637b128 * feat: add error type tooltip icon * chore: switch error Tooltip to TooltipIcon several tooltips were just wrapping fa-exclamation-circle, which TooltipIcon now supports via type='error'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #15541
before
after
@cjcenizal @sqren I found another problem caused the react 16. Looks like
pui-react-tooltipis getting pushed to the left because the width is not properly set. Any ideas why upgrading to react 16 would cause the element's width to be improperly set?