Skip to content

Carousel still autoplays after first interaction when data-slide / data-bs-slide omitted #32640

Closed

Description

@patrickhlauke

From the documentation, I would assume that a carousel only autoplays if it either has data-bs-ride="true" (autoplays after the first interaction) or data-bs-ride="carousel" (autoplays on load).

When testing this on https://deploy-preview-32638--twbs-bootstrap.netlify.app/docs/5.0/components/carousel/#suppressing-touch-swiping and https://deploy-preview-32639--twbs-bootstrap.netlify.app/docs/4.5/components/carousel/#suppressing-touch-swiping it seems that omitting the data-bs-ride (or data- for 4.5) altogether still ends up behaving like data-bs-ride="true", i.e. after first interaction with the prev or next button, it starts autoplaying anyway (even though the default is, supposedly, false)

Is this...expected?

Activity

  1. added
    jsJavaScript or TypeScript sources and plugins
    v4v4, the frozen docs on gh-pages
    v5v5, the v5-dev branch
    on Dec 28, 2020
  2. changed the title [-]Carousel `data-slide` / `data-bs-slide` weirdness[/-] [+]Carousel still autoplays after first interaction when `data-slide` / `data-bs-slide` omitted[/+] on Dec 28, 2020
  3. patrickhlauke commented on Dec 28, 2020

    @patrickhlauke
    MemberAuthor

    or is this controlled via the .slide class as well? i.e. the presence of .slide will act like data-bs-ride="true"? if so, this is not currently documented anywhere

  4. patrickhlauke commented on Dec 28, 2020

    @patrickhlauke
    MemberAuthor

    tried to work out what the logic here is, but seem to have gotten myself utterly confused in the process...

    in v5 the options table talks about slide as the option. this seems wrong, it's likely ride.

    now for both my v4.5 and v5.0 examples in #32638 and #32639 i removed the data-ride/data-bs-ride attributes from the examples...and yet, they still autoplay after the first interaction. not sure what is going on...if it's me missing something, or if our code is just borked, or...

  5. patrickhlauke commented on Dec 28, 2020

    @patrickhlauke
    MemberAuthor

    also, it sounds like the .slide class should really be renamed to .carousel-slide ?

  6. patrickhlauke commented on Dec 28, 2020

    @patrickhlauke
    MemberAuthor

    now getting a weird suspicion...is there perhaps, by design, no way to actually stop autoplaying at all? but just a choice of autoplaying after interaction (default) or right on page load (carousel)? if so, that seems a horrendous omission

  7. tannermann commented on Dec 28, 2020

    @tannermann

    Did you try adding data-bs-interval="false" to the carousel?

  8. patrickhlauke commented on Dec 28, 2020

    @patrickhlauke
    MemberAuthor

    urgh, good call @thenomadicmann ... that's rather obtuse design, i have to say... (same for using ride as an option, makes no sense). I'll give it a shot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    jsJavaScript or TypeScript sources and pluginsv4v4, the frozen docs on gh-pagesv5v5, the v5-dev branch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions