pointerUp error with Orbitcontrol after new window opens

I am using css3Drenderer to bring my Div tags to create a 3d scene in three js.

I wanted to make each div tags to be clicked and when the camera is pointed to certain div tag, when it is clicked again then new window opens.

But when the new window is opened, the onPointerup seems not read and works as the pointerdown is activated constantly.

i’ve tried to implement
quoteElements[i].dispatchEvent(new PointerEvent(“pointerup”));
but it is not working.

How can I make my pointerUp set so that it doesn’t interfere with my Orbitcontrol afterwards?
Thank you for your help in advance!

for (let i = 0; i < quoteElements.length; i++) {
let cssElement = createCSS3DObject(quoteElements[i]);
const x = Math.random() * 2500 - 1250;
const y = Math.random() * 2500 - 1250;
const z = Math.random() * 2000 - 1250;
cssElement.position.set(x, y, z);

const rx = Math.random() * 2 * Math.PI;
const ry = Math.random() * 2 * Math.PI;
const rz = Math.random() * 2 * Math.PI;
cssElement.rotation.set(rx, ry, rz);

scene.add(cssElement);
elements.push(cssElement);

// cssElement.addEventListener;

// Add event listener for click effect
quoteElements[i].addEventListener("pointerdown", function () {
  if (currentIndex == i) {
    quoteElements[i].dispatchEvent(new PointerEvent("pointerup"));
    window.open(quoteElements[i].querySelector("a").getAttribute("href"));
  } else {
    currentIndex = i;
    positionCameraToViewElement(elements[currentIndex]);
  }
});

Why not just process the whole thing through pointer up initially? Eg…

// Add event listener for click effect
quoteElements[i].addEventListener("pointerup", function () {
  if (currentIndex == i) {  

  }
  else {

  }
});