Problem/Motivation

The default Splide config in slideshow.twig uses the bare word loop as a value 'type': loop. Outside a {% for %} block, loop is undefined in Twig and evaluates to null, producing data-splide='{"type":null}'. Splide fails to initialize and the carousel does not function.

Steps to reproduce

1. Add a Slideshow paragraph with at least one slide.
2. Do not pass an explicit options.type from the bridge template.
3. Inspect the rendered HTML — data-splide contains "type":null and the carousel is broken.

Proposed resolution

prototype-sdc-null-safety.patch` — changes 'type': loop to 'type': 'loop'.

Comments

grgcrlsn321 created an issue. See original summary.

grgcrlsn321’s picture

StatusFileSize
new4 KB
grgcrlsn321’s picture

Actually, this patch and issue resolves this issue. It's somewhat related with null values. I think we could probably follow one issue for this.

https://www.drupal.org/project/prototype/issues/3586310

grgcrlsn321’s picture

Status: Active » Closed (duplicate)

Closing this issue as duplicate in favor of
https://www.drupal.org/project/prototype/issues/3586310

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.