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 with 2 items shows only #6579

Open
swiftanthony opened this issue Jul 20, 2020 · 3 comments
Open

Carousel with 2 items shows only #6579

swiftanthony opened this issue Jul 20, 2020 · 3 comments

Comments

@swiftanthony
Copy link

Materialize css version: 1.0.0

JS:

$('.carousel').carousel({
    dist: 0,
    shift: 5,
    numVisible: 5,
    indicators: true,
    noWrap: false,
    fullWidth: false,
    duration: 200,
});

HTML:

<div class="carousel">
    <a class="carousel-item" href="#four!"><img src="https://lorempixel.com/250/250/nature/4"></a>
    <a class="carousel-item" href="#five!"><img src="https://lorempixel.com/250/250/nature/5"></a>
</div>

When there are 2 items in carousel only one is visible.
This is due to incorrect calculation of opacity.

Codepen for version 1.0.0 showing the issue: https://codepen.io/swiftanthony/pen/pogqEYo
Codepen for version 0.100.2 where same code works correctly: https://codepen.io/swiftanthony/pen/KKVbgJP

@swiftanthony
Copy link
Author

It seems this commit is a culprit:
cbb4523#diff-ded54852f17bdc9eaad04d7492954385

@Durkee
Copy link

Durkee commented Aug 26, 2020

Why are bugs not getting fixed (feel the 32k stars)? Is there a workaround for this issue?

@Smankusors
Copy link

if someone can fix this, the PR would be welcome at https://github.com/materializecss/materialize 😉

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

No branches or pull requests

3 participants