prevent accidental swipe gestures when scrubbing video/audio timelines
parent
290c251c7e
commit
be110fad11
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,5 @@
|
|||
import { isAndroid } from '../utils/device.js'
|
||||
import { matches } from '../utils/util.js'
|
||||
|
||||
const SWIPE_THRESHOLD = 40;
|
||||
|
||||
|
@ -82,6 +83,9 @@ export default class Touch {
|
|||
*/
|
||||
isSwipePrevented( target ) {
|
||||
|
||||
// Prevent accidental swipes when scrubbing timelines
|
||||
if( matches( target, 'video, audio' ) ) return true;
|
||||
|
||||
while( target && typeof target.hasAttribute === 'function' ) {
|
||||
if( target.hasAttribute( 'data-prevent-swipe' ) ) return true;
|
||||
target = target.parentNode;
|
||||
|
|
Loading…
Reference in New Issue