Tippyjs: The undefined props are not set to defaults

Created on 25 Jun 2020  路  4Comments  路  Source: atomiks/tippyjs

Bug description

If pass the undefined option, then tippy will use this value instead of setting the default value

Reproduction

tippy('button', {
  content: 'tooltip',
  trigger: undefined
});

`Uncaught TypeError: Cannot read property 'split' of undefined`

CodePen link: https://codepen.io/makarov906/pen/oNbwErz

馃悰 bug

Most helpful comment

Hmm yeah I guess.

All 4 comments

That's how object spreading works, { ...defaults, ...specified}, the undefined value takes over the default. How should it work?

I expect defaults options to be applied

Hmm yeah I guess.

Why has this been closed? I think this is a valid bug. I was just creating a wrapper component for this and had to manually remove all undefined props before passing them to tippy. I agree with @makarov906 that default values should be applied.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewckor picture andrewckor  路  4Comments

dpatra picture dpatra  路  4Comments

Christian24 picture Christian24  路  3Comments

mreinstein picture mreinstein  路  5Comments

Kearsan picture Kearsan  路  3Comments