fix: relax swipe condition

This commit is contained in:
kakkokari-gtyih 2026-01-15 00:43:12 +09:00
parent b96290e778
commit c8d8d92d82
1 changed files with 4 additions and 3 deletions

View File

@ -310,13 +310,14 @@ function moveCancelByTouch(_event: TouchEvent) {
/** 横スワイプに関与する可能性のある要素を調べる */ /** 横スワイプに関与する可能性のある要素を調べる */
function hasSomethingToDoWithXSwipe(el: HTMLElement) { function hasSomethingToDoWithXSwipe(el: HTMLElement) {
//
if (['INPUT', 'TEXTAREA'].includes(el.tagName)) return true; if (['INPUT', 'TEXTAREA'].includes(el.tagName)) return true;
if (el.isContentEditable) return true; if (el.isContentEditable) return true;
if (el.scrollWidth > el.clientWidth) return true;
const style = window.getComputedStyle(el); const style = window.getComputedStyle(el);
if (['absolute', 'fixed', 'sticky'].includes(style.position)) return true; //
if (style.overflowX === 'scroll') return true; if (['scroll', 'auto'].includes(style.overflowX) && el.scrollWidth > el.clientWidth + 1) return true;
//
if (style.touchAction === 'pan-x') return true; if (style.touchAction === 'pan-x') return true;
if (el.parentElement != null && el.parentElement !== rootEl.value) { if (el.parentElement != null && el.parentElement !== rootEl.value) {