Skip to content

Bug: isSwipePrevented disables swiping when data-background-audio or data-background-video is played #3584

@jeertmans

Description

@jeertmans

Hello,

I maintain a tool that generates video slides, and one of the export formats is RevealJS.

All slides are played as data-background-video, see https://eertmans.be/manim-slides-starter/ for example.

I am not the first to notice that swiping on touch devices does not work on that kind of slides, see #3302 or jeertmans/manim-slides#384 (for a similar issue on my repo).

After searching a bit, it seems like the faulty lines are there:

/**
* Checks if the target element prevents the triggering of
* swipe navigation.
*/
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;
}
return false;
}

Looking at the comments, the fact that this function returns true for data-background-* contents seems to be an undesirable side effect, because we do not have the timeline for both the audio and the video when they are put in the background.

If that is an intended effect of the function, then it might be nice to add an optional attribute to force swipe-enabling? I.e., something that does the opposite of data-prevent-swipe.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions