Problem/Motivation

Stuff like https://getbootstrap.com/docs/5.3/components/carousel/#individual-carous... makes me think that it should just be a prop on the carousel item component.

Proposed resolution

But due to the fact that the active class should be directly on the carousel item element and that the carousel component had difficulties due to wrappers to add the class at the right place, I wonder if we should:

- put back carousel-item into the carousel item component
- add some kind of workaround like for accordion item https://git.drupalcode.org/project/ui_suite_bootstrap/-/blob/5.0.x/templ...
- or try to "fix" upstream in Bootstrap.

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

grimreaper created an issue. See original summary.

grimreaper’s picture

Assigned: Unassigned » grimreaper

grimreaper’s picture

Assigned: grimreaper » pdureau
Status: Active » Needs review

If you are ok with that I will create a change record.

grimreaper’s picture

  • grimreaper committed 62c6fe8d on 5.0.x
    Issue #3484065 by grimreaper, pdureau: Rework carousel item
    
grimreaper’s picture

Assigned: pdureau » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

grimreaper’s picture

Assigned: Unassigned » pdureau
Status: Closed (fixed) » Needs work

@pdureau,

As discussed on phone, I am re-opening this issue because I think it broke Views usage.

I am ok to revert the change for 5.0.x as I think this would require new mechanism from UIP2.

For views: we need to be able to control the "active" boolean prop with the fact that the element is the first (or nth) result.
For field formatters: we need to be able to control the "active" boolean prop with the fact that the element is the first (or nth) element/delta.

grimreaper’s picture

Assigned: pdureau » grimreaper

Remove active prop.
Custom JS that will check all carousel items and will place the active class on the first one if none have the active class.

  • grimreaper committed b7953c36 on 5.1.x
    Issue #3484065 by grimreaper, pdureau: Fix components after new UIP...

  • grimreaper committed cda06b36 on 5.1.x
    Issue #3484065 by grimreaper, pdureau: Carousel item: remove active prop...

grimreaper’s picture

Version: 5.0.x-dev » 5.1.x-dev
Assigned: grimreaper » Unassigned
Status: Needs work » Fixed

  • grimreaper committed 3e30cb3d on 5.0.x
    Issue #3484065 by grimreaper, pdureau: Carousel item: remove active prop...

Status: Fixed » Closed (fixed)

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