Tippyjs: createSingleton does not use correct function content in 6.0

Created on 4 Mar 2020  路  2Comments  路  Source: atomiks/tippyjs

Bug description

Hi. There's some regression in createSingleton method when tippy's content prop is a function. Please open [email protected] reproduction link and take a look at the console logs. You can see that content function is called 4 times but it should be called 3 times (3 tippy instances). Fourth call receives some ghost div element which isn't even in the DOM which makes the content set to an empty string.

Reproduction

[email protected] - https://jsfiddle.net/uh9aftcm/
[email protected] - https://jsfiddle.net/pmwfn41h/

馃悰 bug

All 2 comments

And the bug itself is caused by createSingleton's onTrigger hook that receives wrong instance (the 4th one, created on empty div with no content) and overrides content prop on all previous instances.

Never mind, I got it wrong. It seems like the reference element used to evaluate computedContent is the one that is created for purposes of singleton instance.

2020-03-04_17-08-00

Was this page helpful?
0 / 5 - 0 ratings

Related issues

makarov906 picture makarov906  路  4Comments

mreinstein picture mreinstein  路  5Comments

divmgl picture divmgl  路  3Comments

faroukcharkas picture faroukcharkas  路  4Comments

patrickhlauke picture patrickhlauke  路  3Comments