Swiper not initialized after Ajax requests

Created on 15 October 2024, about 1 month ago

Problem/Motivation

Swiper not initialized after Ajax requests, for example if you have a Drupal commerce and the swiper is setup to work on product variation, changing variation will make an Ajax request, and the swiper will not work

Steps to reproduce

Setup an image field in Drupal commerce product variation as a swiper, and change the variation from the product page

Proposed resolution

Reattach JS behavior after Ajax calls

Remaining tasks

Patch

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇯🇴Jordan Anas_maw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Anas_maw
  • 🇯🇴Jordan Anas_maw

    This patch should solves the issue

  • 🇳🇱Netherlands nk_

    Thanks. I was not able to produce this so far, though with a very basic example on existing commerce web site? Maybe more background info on theme/assets/caching other stuff on your end? And honestly, I do not prefer putting back jQuery dependency in 2.0.x version, especially not for just one line of code.

Production build 0.71.5 2024