Mobile tap issue fix (#19121)

This commit is contained in:
Rajat Talesra 2023-02-16 00:38:02 +05:30 committed by GitHub
parent 888bdd9b88
commit 8c2cbab726
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -198,6 +198,11 @@ function openDrawerOnHover() {
});
if (isTouchDevice()) {
drawerTrigger.addEventListener('click', function () {
var articleId = document.getElementById('article-body').dataset.articleId;
reactToArticle(articleId, 'like');
});
watchForLongTouch(drawerTrigger);
drawerTrigger.addEventListener('longTouch', function () {
drawerTrigger.parentElement.classList.add('open');

View file

@ -3,7 +3,7 @@
// for the element, as otherwise device will default to opening a context menu instead.
function watchForLongTouch(element) {
const longTouchEvent = new Event('longTouch');
const minDuration = 800;
const minDuration = 500;
let timer;
// In the event of a long touch, dispatch the "longTouch" event