ument.removeEventListener("touchend", cancelLongpress);
              app.ports.highlighterOnTouchEvent.send(["longpress", id, idx]);
            }, 500);

            // on touchmove or touchend, cancel the longpress timeout
            function cancelLongpress() {
              console.log("longpress cancel", id);
              clearTimeout(longpressTimeout);
              document.removeEventListener("touchmove", cancelLongpress);
              document.removeEventListener("touchend", cancelLongpress);
 