TypeError: e.$element is null / TypeError: r.$element is null
-
I got tired of seeing these bugs, so I set a conditional breakpoint on every line that contained one of them. This is where they're happening:
One of them looks like the hide function inside the tooltip prototype destroy function, and the other one looks like it's inside the tooltip prototype show function, but I'm not really sure what it's doing.
Anyway, maybe one of the devs can figure out how to make it not clutter the console with these two JS errors?
-
Browser is Firefox, BTW, but the errors also occur when I'm using Chrome.
-
@anotherusername said in TypeError: e.$element is null / TypeError: r.$element is null:
One of them looks like the hide function inside the tooltip prototype destroy function, and the other one looks like it's inside the tooltip prototype show function, but I'm not really sure what it's doing.
The first bug is very likely to be https://github.com/twbs/bootstrap/issues/20511 (which has a resolution), the second one smells very much the same, like two racing event handlers, one of which removes the element from the DOM before the second one can run. A lot of Bootstrap code includes sanity checks like
if (x.$element) { /* do smth with .$element */}
, but the tooltip code doesn't seem to.I can reliably reproduce this by quickly hovering over the (> 0) votes counter on a post twice before the tooltip fully fades into view, e.g. mouse motion from button to and back to .
-
@DCoder said in TypeError: e.$element is null / TypeError: r.$element is null:
two racing event handlers, one of which removes the element from the DOM before the second one can run
I would've guessed as much.