fix: prevent tooltip action when there is no ref element#1
Conversation
|
|
||
| // Calculation the position | ||
| updatePosition() { | ||
| if (!this.tooltipRef) { |
There was a problem hiding this comment.
This means we always need to pass a ref for this to work right?
There was a problem hiding this comment.
react-tooltip must have ref to be able to perform getBoundingClientRect on its node, otherwise we are trying to call getBoundingClientRect on undefined.
|
@Baael do you think it would be possible to contribute this back to the original library? You mentioned before that there are multiple issues there with this problem, so not sure if they accept this. Also, could you add some more context in the description of the PR opf why is this required? I know you mentioned it before but just so it stays documented! |
yes, I think that we will make our master to official master. Sure, sorry for lack of info. |
Simply check if there is a ref element, to prevent calling
getBoundingClientRecton undefined or null.