Problem/Motivation

The Swiper.js library provides two important touch control options that are currently not exposed in the Swiper Formatter module configuration:

simulateTouch - Allows the slider to accept mouse events like touch events on desktop (click and drag to change slides). Default: true
allowTouchMove - Enables/disables touch and drag navigation. When disabled, slides can only be changed via navigation buttons, pagination, or programmatically. Default: true

These options are useful for cases where:

You want to disable mouse drag on desktop while keeping touch on mobile
You need a slider that can only be controlled via navigation buttons (e.g., for accessibility or specific UX requirements)

Proposed resolution

Add simulateTouch and allowTouchMove as checkbox options in the "Slides options" section of the Swiper template configuration form.

CommentFileSizeAuthor
#4 swiper_formatter-3567694-1.patch3.21 KBahmad-alyasaki
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ahmad-alyasaki created an issue. See original summary.

ahmad-alyasaki changed the visibility of the branch 3567694-add-simulatetouch-and to hidden.

ahmad-alyasaki changed the visibility of the branch 3567694-add-simulatetouch-and to active.

ahmad-alyasaki’s picture

StatusFileSize
new3.21 KB
bbu23’s picture

Version: 2.0.x-dev » 2.1.x-dev
Category: Task » Feature request
Status: Active » Needs work

Hi,

Thanks for creating this issue and providing a solution.

Please provide a merge request, we are not reviewing patch files.

ahmad-alyasaki’s picture

Status: Needs work » Needs review

Hi,

Thank you for your feedback.

The merge request has been created as requested.

bbu23’s picture

Assigned: Unassigned » bbu23

  • bbu23 committed bdc6f0b2 on 2.1.x
    test: #3567694 Add update path test for simulateTouch and allowTouchMove...

  • bbu23 committed 1b7b4f77 on 2.1.x
    feat: #3567694 Add simulateTouch and allowTouchMove options to Swiper...

  • bbu23 committed 1711a3e0 on 2.1.x
    test: #3567694 Add tests for SwiperUpdater service
    

  • bbu23 committed 23b87826 on 2.1.x
    refactor: #3567694 Extract update logic into new SwiperUpdater service
    
bbu23’s picture

Assigned: bbu23 » Unassigned
Status: Needs review » Fixed

This will be available in 2.1.0.

Thank you for your contribution!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.