Skip to content

Problem with autoWidth and breakpoints #1384

Description

@antonio-stigliano

Checks

Version

4.1.4

Description

When i resize under 768px, the single card takes up all the space, but when I expand again the window, it keeps width: calc(100% + 0rem); as its width

here's my splide config

const splide = new Splide(container, {
pagination: false,
speed: 800,
arrows: false,
gap: '1rem',
mediaQuery: 'min',
breakpoints: {
768: {
autoWidth: true,
focus: 0,
omitEnd: true,
},
}
});

I've tried changing that into this

const splide = new Splide(container, {
pagination: false,
speed: 800,
arrows: false,
gap: '1rem',
autoWidth: true, //also fixedWidth: '100%',
focus: 0,
omitEnd: true,
breakpoints: {
768: {
autoWidth: false,
fixedWidth: 450px,
focus: 'center',
omitEnd: false,
},
}
});

but the breakpoints don't seem to work at all, or they break during the resize

Reproduction Link

No response

Steps to Reproduce

use the config

Expected Behaviour

when resizing, width doesn't change

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions