Skip to content

set pui-react-tooltip width so div is centered around triggering element#15542

Merged
nreese merged 1 commit intoelastic:masterfrom
nreese:pui-react
Dec 13, 2017
Merged

set pui-react-tooltip width so div is centered around triggering element#15542
nreese merged 1 commit intoelastic:masterfrom
nreese:pui-react

Conversation

@nreese
Copy link
Copy Markdown
Contributor

@nreese nreese commented Dec 12, 2017

fixes #15541

before

screen shot 2017-12-11 at 8 38 19 pm

after

screen shot 2017-12-11 at 8 40 58 pm

@cjcenizal @sqren I found another problem caused the react 16. Looks like pui-react-tooltip is 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?

@nreese nreese changed the title set tooltip width so div is centered around triggering element set pui-react-tooltip width so div is centered around triggering element Dec 12, 2017
Copy link
Copy Markdown
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

@nreese nreese requested a review from stacey-gammon December 12, 2017 18:27
Copy link
Copy Markdown

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nreese nreese merged commit c06b445 into elastic:master Dec 13, 2017
nreese added a commit to nreese/kibana that referenced this pull request Dec 13, 2017
w33ble added a commit to w33ble/kibana that referenced this pull request Apr 5, 2018
w33ble added a commit that referenced this pull request Apr 11, 2018
w33ble added a commit that referenced this pull request Apr 11, 2018
w33ble added a commit that referenced this pull request Apr 11, 2018
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pui-react-tooltip is rendered to far left of screen

3 participants