React-tooltip: Incorrect positioning on mobile using effect='solid'

Created on 11 Apr 2018  Â·  8Comments  Â·  Source: wwayne/react-tooltip

Code:

<button data-tip='bla bla bla blbllblb lbalballbl blaba bla bal bal'>'Test'</button>
<ReactTooltip effect='solid' place='bottom' event='click' />

The current mobile result:
screen shot 2018-04-11 at 15 08 52

Expected result (Centered tooltip):
screen shot 2018-04-11 at 15 04 36

PS: the arrow positioning also is wrong

Most helpful comment

Any update on this? I have this issue as well
screen shot 2018-07-13 at 11 17 44
Position render correctly after second render; top (first render) bottom (second render). In my case, top property got wrong calculation in the first render but correct in second render

All 8 comments

Yes, that result is much more desirable. How did you generate the 'expected result'? some style hacking we could use to fix the problem?

Do you have a suggested fix? I'm not set up to develop or test fixes on mobile...

To fix it I just changed the left property to 0, my suggestion is when you calculating the left value check if it's mobile if it's just don't set it, once that you are setting it directly in the element.style we just can't change it using CSS (actually we can but we need use !import).
You can test it easily using the Google Chrome mobile device view.

Any update on this? I have this issue as well
screen shot 2018-07-13 at 11 17 44
Position render correctly after second render; top (first render) bottom (second render). In my case, top property got wrong calculation in the first render but correct in second render

The position is always wrong on first appearance however we use it. Since this issue is 2 years old I figure we're better off finding another package.

Or you could help debug and contribute a fix!

On Thu, May 7, 2020 at 1:27 PM Max Howell notifications@github.com wrote:

The position is always wrong on first appearance however we use it. Since
this issue is 2 years old I figure we're better off finding another package.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/wwayne/react-tooltip/issues/374#issuecomment-625392123,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEX6THPFX6BSP6QQQM4SUVDRQLVO7ANCNFSM4E2ANJYA
.

So…. no, I won’t. I am an extremely prolific contributor to open source, but only if it looks like it's a maintained package. Sorry.

@mxcl your comment is gross

This can be achieved using the place prop. Like if you have a question mark on the left side of the screen as I have. Then use place = right similarly left if the question mark is on the right.

<ReactTooltip id={id} type="success" effect="solid" multiline={true} border textColor="#fff" place="right" backgroundColor="#042E60" />

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benbro picture benbro  Â·  3Comments

alex6633 picture alex6633  Â·  3Comments

Ericky14 picture Ericky14  Â·  3Comments

donilan picture donilan  Â·  4Comments

bonbonio picture bonbonio  Â·  4Comments