Skip to content

delayCalculatePosition

Pre-release
Pre-release
Compare
Choose a tag to compare
@james-carrots james-carrots released this 29 Jul 00:10
· 5 commits to master since this release
9238bab

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

https://github.com/instacart/Snacks/pull/465/files