-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
映像UIのシークバーを動かすと横スワイプも動いてしまう #13037
Comments
横に長いコードブロックのスクロールバーでもスワイプ判定されてしまい、ノート検索からユーザー検索にスライドされました(デッキモード、Android) |
当該の要素にstopPropagationをつければ解決するけどそういう実装はやりたくない(他コンポーネントへの干渉は避けたい) |
event.targetの要素から再帰的に一つずつ要素を見ていって、横方向へのドラッグやoverflowがあるものが存在するかを見ていくわけにもいかないし・・・ |
|
結局これで実装した /** 横スワイプに関与する可能性のある要素を調べる */
function hasSomethingToDoWithXSwipe(el: HTMLElement) {
if (['INPUT', 'TEXTAREA'].includes(el.tagName)) return true;
if (el.isContentEditable) return true;
if (el.scrollWidth > el.clientWidth) return true;
const style = window.getComputedStyle(el);
if (['absolute', 'fixed', 'sticky'].includes(style.position)) return true;
if (['scroll', 'auto'].includes(style.overflowX)) return true;
if (style.touchAction === 'pan-x') return true;
if (el.parentElement && el.parentElement !== rootEl.value) {
return hasSomethingToDoWithXSwipe(el.parentElement);
} else {
return false;
}
} |
💡 Summary
映像UIのシークバーを動かすと、横スワイプも動いてしまう。
※ 横スクロール可能なコードブロックでも確認
🥰 Expected Behavior
映像UIのシークバーを動かすと、映像UIのシークバーが動く
🤬 Actual Behavior
映像UIのシークバーを動かすと、映像UIのシークバーが動き、横スワイプも動く
📝 Steps to Reproduce
💻 Frontend Environment
🛰 Backend Environment (for server admin)
Do you want to address this bug yourself?
The text was updated successfully, but these errors were encountered: