Skip to content

Commit

Permalink
Merge pull request #1906 from Codeinwp/fix/slider-not-working
Browse files Browse the repository at this point in the history
Slider not working inside a flex container
  • Loading branch information
HardeepAsrani authored Dec 18, 2023
2 parents 9eb25ea + 0bbfa37 commit d3997e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/blocks/blocks/slider/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
--width: auto;

width: var( --width );
display: grid;

.glide__track {
border: var( --border-width ) solid var( --border-color );
border-radius: var( --border-radius );
overflow: hidden;
}

.glide__slides {
height: var( --height );
animation: load 4s 3;
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/frontend/slider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const init = () => {
slider.appendChild( el.firstElementChild );
}

new window.Glide( `#${ slider.id }`, {
new window.Glide( slider, {
...slider.dataset,
type: 'carousel',
keyboard: true,
Expand Down

0 comments on commit d3997e8

Please sign in to comment.