Kevin Powell - CommunityKP-C
Kevin Powell - Community13mo ago
4 replies
Dovah

'touchend' event triggering RightMouseButton?

https://idyllic-raindrop-f32a0c.netlify.app/

I have this weird thing happening when I go to mobile view, click "add to cart" and then hold "+"/"-" button so that it start incrementing number on hold, at the end it triggers RMB window with "inspect" and other options.

Anyone knows the reason?

incrementNumber[i].addEventListener('touchstart', e => {
                pressed = true;
                scoreIn = Number(ammount[i].innerText);
                intervalIn = setTimeout(function(){
                    intervalIn = setInterval(() => {
                    scoreIn++;
                    ammount[i].innerText = scoreIn;
                    }, 100);
                },500)
            });
        
            incrementNumber[i].addEventListener('touchend', e => {
                    clearTimeout(intervalIn);
                    clearInterval(intervalIn);
                    if(pressed === true) {
                        cardName = cardLongName[i];
                        itemAmmount = scoreIn;
                        incrementAmmount();
                        pressed = false;
                    }
            });
Was this page helpful?