Aim to provide workaround event listeners for touch devices(such as 'long press' event), since some mobile browsers do not fully response to 'click' or 'contextmenu' events expectedly.
- longPress
Pressing the touch screen and hold for spectific time(customizable). Event will not be triggered if the gesture moved or touchMove is fired during pressing.
- more to be implemented... 🤣
yarn add touchils
npm install touchils -S
(ES Module import only)
import { LongPress } from 'touchils';
const longPressEvt = new LongPress(document.getElementByID('test'), (e) => {
alert('long press');
}));
longPressEvt.remove();