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

style position rounding

Open LennartSpitzner opened this issue 3 years ago • 1 comments

Hey, thanks for the package!

I run into an issue about placement with active browser page zooming. Positioning is off by a few pixels (which is not very noticable, but breaks some add-on behaviour we have). But it made me wonder, why does react-tooltip appear to truncate numbers when assigning element's position (style).

The fix for #146 involved adding parseInt as.. a means to do rounding? I wonder, can we replace this by proper rounding, or is there some advantage to parseInt over Math.round ?

LennartSpitzner avatar Nov 09 '21 10:11 LennartSpitzner

sorry, did not mean to send that stub of an issue, but apparently "enter" means "publish". will edit it in a sec.

LennartSpitzner avatar Nov 09 '21 10:11 LennartSpitzner

Hi, @LennartSpitzner can you check if this still being a problem with the latest published version, please?

If yes, can you please do PR?

Thanks!

danielbarion avatar Nov 09 '22 14:11 danielbarion

@danielbarion finally I was able to test this again, sorry for the delay.

Short answer: I could not reproduce any problem related to tooltip positioning when zooming any longer. Thanks!

(#743 simplified our code significantly without any need to reproduce rounding logic on our end. To check I reverted to an older version of our code that did not use #743, but I still could not reproduce any problem either. So all good.)

LennartSpitzner avatar Nov 28 '22 13:11 LennartSpitzner