Skip to content

Conversation

fvdpol
Copy link

@fvdpol fvdpol commented Jan 8, 2025

The carousel code fails when the 1st slide contains more than one list elements.
This can be reproduced by updating the slogan.yaml:

weight: 1
title: "Moodle + Raspberry = MoodleBox"
description: >
  <ul class="list-style-none">
     <li>A small box on the table that brings Moodle to the entire classroom has a touch of magic!</li>
     <li>2nd line on 1st slide</li>
   </ul>
image: "/img/carousel/raspberry-pi-case.png"

This will raise a javascript runtime error:

carousel.js:16  Uncaught SyntaxError: Failed to execute 'querySelectorAll' on 'Element': 'ol li:nth-last-child(-n + -29)' is not a valid selector.
    at carousel.js:16:30
    at NodeList.forEach (<anonymous>)
    at HTMLDocument.<anonymous> (carousel.js:7:13)
	

The fix in this PR will correct the selection appropriate element, allowing the use of multiple list items on the 1st slide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant