react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

Tooltip positioning is broken from v3.1.5

Open pokidovea opened this issue 10 years ago • 7 comments

In version 3.1.4 it works fine, but from 3.1.5 a tooltip becomes pulled to top. Check, please, what has been changed. I assume that it works well in your environment, but we have this strange issue and it depends on version.

pokidovea avatar Aug 19 '16 11:08 pokidovea

are you using getcontent?

wwayne avatar Aug 19 '16 14:08 wwayne

yes

pokidovea avatar Aug 19 '16 18:08 pokidovea

can you try 3.1.6, if it doesn't work, could you show me mor detail of your code, currently I dont know how to reproduce your problem

wwayne avatar Aug 20 '16 04:08 wwayne

@pokidovea If any of your css classes uses a transform, tooltips will probably fail miserably. Take a look @ the new attribute introduced in 3.1.5: countTransform. You might need to set it to false.

@wwayne Not that I have a better idea, but I'm not sure breaking on a transform != "none" is the best one. The offsets have been wrong for every calculation of the parent's location wherever I have transforms, so I'm forced to use countTransform=false everywhere. Maybe that's the intended use case, but here's a simple example:

ReactDOM.render(
    <div style={{textAlign: "center"}}>
        <p style={{
            transform: "translate(0, 0)"
        }} data-tip="This is a react-tooltip">
            Some text
        </p>
        <ReactTooltip />
    </div>,
    ...
);

FYI I stumbled on this issue because the Google material design icons package (https://github.com/Templarian/MaterialDesign) adds the same transform I used in the example above in it's base 'mdi' classes.

cklab avatar Aug 22 '16 17:08 cklab

@cklab, thanks! Setting countTransform to false solved the problem.

pokidovea avatar Aug 26 '16 11:08 pokidovea

@wwayne is there a way to force the position of the tooltip? Right now @3.1.6 I'm setting position bottom, but seems that depending of the length of the text it changes to another position.

iamgutz avatar Sep 06 '16 17:09 iamgutz

@iamgutz Yeah it will adjust position automatically and no option for keep it for the moment...maybe I need to add an option fot this in the future

wwayne avatar Sep 06 '16 23:09 wwayne