Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
patrickhlauke opened this issue Dec 28, 2020 · 6 comments

Comments

@patrickhlauke
Copy link
Member

patrickhlauke commented Dec 28, 2020

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?

@patrickhlauke patrickhlauke changed the title Carousel data-slide / data-bs-slide weirdness Carousel still autoplays after first interaction when data-slide / data-bs-slide omitted Dec 28, 2020
@patrickhlauke
Copy link
Member Author

patrickhlauke commented Dec 28, 2020

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

@patrickhlauke
Copy link
Member Author

patrickhlauke commented Dec 28, 2020

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...

@patrickhlauke
Copy link
Member Author

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

@patrickhlauke
Copy link
Member Author

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

@tannermann
Copy link

tannermann commented Dec 28, 2020

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

@patrickhlauke
Copy link
Member Author

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
Projects
None yet
Development

No branches or pull requests

2 participants