uiv-lib/uiv

Unable to get property 'getBoundingClientRect' of undefined or null reference

Closed this issue · 2 comments

Describe the bug
This regards the popover code. Essentially, code is being executed after the popup instance has already been destroyed, thus causing this issue.

To Reproduce
Unfortunately I'm unable to supply this, as there's no sure-fire way of reproducing the issue.

Additional context
Unable to get property 'getBoundingClientRect' of undefined or null reference
./node_modules/uiv/dist/uiv.esm.js in isAvailableAtPosition at line 397:1

function isAvailableAtPosition(trigger, popup, placement) {
  var triggerRect = trigger.getBoundingClientRect();
  var popupRect = popup.getBoundingClientRect();
  var viewPortSize = getViewportSize();
  var top = true;
  var right = true;
  var bottom = true;
  var left = true;

I have same problem.
Maybe just do return false if the element does not exist in function setTooltipPosition?
domUtils 213:3

export function setTooltipPosition (tooltip, trigger, placement, auto, appendToSelector, viewport) {
  if (!trigger || !tooltip) return false
  const isPopover = tooltip && tooltip.className && tooltip.className.indexOf('popover') >= 0
wxsms commented

Thanks for the bug report. Solved as @Vovanostm suggested. pls try in next release.