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

Cannot read property 'settings' of undefined

Open jabidof opened this issue 7 years ago • 16 comments

HI there,

Great lib, very handy and simple. I'm getting below error when I have hundreds of <div>'s rendered. That seems to be related to the mounting/unmounting mechanism in React-Tippy.

The data property within R-T is undefined.

Any chance to help me debugging this?

Thanks J.

react-tippy.js:2317 Uncaught TypeError: Cannot read property 'settings' of undefined
    at Tippy.hide (react-tippy.js:2317)
    at hide (react-tippy.js:1561)
    at triggerHide (react-tippy.js:1596)
    at HTMLDocument.handleMousemove (react-tippy.js:1613)

jabidof avatar Jan 06 '18 21:01 jabidof

When I removed "delay" property from settings tippy component it became works fine for me

AlexSergey avatar Jan 07 '18 19:01 AlexSergey

You mean setting "delay" to 0? That is its default value.

Or you mean some other hack? Can you detail a bit?

Thanks and happy Christmas!

jabidof avatar Jan 07 '18 21:01 jabidof

In my project I used delay=300, and I reproduced the same bug. But when I had removed this delay setting this bug disappeared and it worked fine. Happy Christmas to you too!

AlexSergey avatar Jan 07 '18 22:01 AlexSergey

To solve this problem you can simply replace 'title' attribute with HTML content like this

<Tooltip
      trigger="mouseenter"
      size='small'
       html={(
                 <p>here's your tooltip also you can get info like this</p>
           )}>
     Hover me, this will fix your problem
                                    </Tooltip>

DevJett avatar Feb 05 '18 00:02 DevJett

Hi @liamm12 I'm already using html and it's not working for me. It sounds like the React Component unmounts before tippy hides, then when tippy tries to hide it crashes.

Any other idea on how to fix this?

bernatfortet avatar Feb 09 '18 07:02 bernatfortet

Having the same issue by just updating the disabled props to true.

blaadje avatar Feb 16 '18 13:02 blaadje

This is causing us unrecoverable crashes in production. Anyone working on a fix?

sontek avatar Feb 20 '18 16:02 sontek

I have similar issues:

Cannot read property 'el' of undefined

      if (!document.body.contains(data.el)) {
        this.destroy(popper);
        return;
      }

I also get Cannot read property 'settings' of undefined

farukg avatar Feb 28 '18 10:02 farukg

Sorry for not being active on Github, @bernatfortet can you attach your code on CodeSandBox so we could identify the source of this problem

Working example

DevJett avatar Mar 05 '18 12:03 DevJett

@jabidof did you find a way to fix this? I've been gnashing teeth on it.

kpennell avatar Mar 24 '18 22:03 kpennell

@farukg any luck on this?

kpennell avatar Mar 24 '18 22:03 kpennell

@sontek Any workaround or fixes you figured out?

kpennell avatar Mar 24 '18 22:03 kpennell

Still a problem. Gosh!! Is there a way to block tippy on touch devices?

nicubarbaros avatar Jul 04 '18 08:07 nicubarbaros

For me it was if I was using the delay it will give this error. Now, after removing, it works, (i think so)

nicubarbaros avatar Jul 11 '18 07:07 nicubarbaros

Ran into this issue when putting a button inside the tooltip. Removing the 'onClick' handler worked, but unfortunately I kinda need it. Edit: the onClick handler was eventually affecting state that caused the tooltip to get re-rendered. Gonna try fiddling with a delay, or maybe a manual hide after changing state.

izaleu avatar Aug 06 '18 05:08 izaleu

The same issue, but it only occurs on IE 11 or edge.

Christophvh avatar Aug 31 '18 13:08 Christophvh