Introducing a new prop delayCalculatePosition to Tooltip that propagates to TooltipOverlay > TooltipPosition.
A client must pass in delayCalculatePosition={true} when consuming the Tooltip react component.
When delayCalculatePosition is set to true, TooltipPosition will wait 300ms before doing the calculation of tooltip offsets.
This delay is necessary for cases when the overlays are not set and final, and prevents expensive and buggy recalculation as opposed to getting it right the first time.
Note: This also reverts 0.0.157's change of using offsetWidth instead of scrollWidth.
0.0.158 will use scrollWidth.
so this.calculatePosition() is reverted to be the same as versions prior to 0.0.157
Introducing a new prop
delayCalculatePosition
toTooltip
that propagates toTooltipOverlay > TooltipPosition
. A client must pass indelayCalculatePosition={true}
when consuming the Tooltip react component.When delayCalculatePosition is set to true, TooltipPosition will wait 300ms before doing the calculation of tooltip offsets. This delay is necessary for cases when the overlays are not set and final, and prevents expensive and buggy recalculation as opposed to getting it right the first time.
Note: This also reverts 0.0.157's change of using offsetWidth instead of scrollWidth. 0.0.158 will use scrollWidth.
so this.calculatePosition() is reverted to be the same as versions prior to 0.0.157
https://github.com/instacart/Snacks/pull/465/files