Skip to content

Commit

Permalink
Bug Fix: Should not remove the predefined inline styles of slides.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaotoshiFujita committed Oct 9, 2021
1 parent da6cf79 commit b3a127b
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/js/splide-renderer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/js/splide.cjs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Splide.js
* Version : 3.1.1
* Version : 3.1.2
* License : MIT
* Copyright: 2021 Naotoshi Fujita
*/
Expand Down Expand Up @@ -1020,7 +1020,7 @@ function Layout(Splide2, Components2, options) {
emit(EVENT_RESIZED);
}
function setSlidesHeight() {
Slides.style("height", cssSlideHeight(), true);
Slides.style("height", cssSlideHeight() || null, true);
}
function cssPadding(right) {
const { padding } = options;
Expand Down
4 changes: 2 additions & 2 deletions dist/js/splide.esm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Splide.js
* Version : 3.1.1
* Version : 3.1.2
* License : MIT
* Copyright: 2021 Naotoshi Fujita
*/
Expand Down Expand Up @@ -1016,7 +1016,7 @@ function Layout(Splide2, Components2, options) {
emit(EVENT_RESIZED);
}
function setSlidesHeight() {
Slides.style("height", cssSlideHeight(), true);
Slides.style("height", cssSlideHeight() || null, true);
}
function cssPadding(right) {
const { padding } = options;
Expand Down
4 changes: 2 additions & 2 deletions dist/js/splide.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/splide.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/splide.min.js

Large diffs are not rendered by default.

Binary file modified dist/js/splide.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splidejs/splide",
"version": "3.1.1",
"version": "3.1.2",
"description": "Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.",
"author": "Naotoshi Fujita",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions src/js/components/Drag/test/general.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe( 'Drag', () => {
const track = splide.Components.Elements.track;

fireWithCoord( track, 'mousedown', { x: 0, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: 0, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: 1, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: -100, timeStamp: 2 } );

expect( splide.Components.Move.getPosition() ).toBe( -100 );
Expand All @@ -24,7 +24,7 @@ describe( 'Drag', () => {
const track = splide.Components.Elements.track;

fireWithCoord( track, 'mousedown', { x: 0 } );
fireWithCoord( window, 'mousemove', { x: 0 } );
fireWithCoord( window, 'mousemove', { x: 1 } );
fireWithCoord( window, 'mouseup' );

expect( splide.Components.Move.getPosition() ).toBe( 0 );
Expand All @@ -40,7 +40,7 @@ describe( 'Drag', () => {
const track = splide.Components.Elements.track;

fireWithCoord( track, 'mousedown', { x: 0, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: 0, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: 1, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: -20, timeStamp: 21 } ); // v = -1
fireWithCoord( window, 'mouseup', { x: -20, timeStamp: 21 } );

Expand All @@ -53,7 +53,7 @@ describe( 'Drag', () => {
const track = splide.Components.Elements.track;

fireWithCoord( track, 'mousedown', { x: 0, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: 0, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: 1, timeStamp: 1 } );
fireWithCoord( window, 'mousemove', { x: -20, timeStamp: 100 } );
fireWithCoord( window, 'mouseup', { x: -20, timeStamp: 100 } );

Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Layout/Layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function Layout( Splide: Splide, Components: Components, options: Options
* Updates the height of slides or their container elements if available.
*/
function setSlidesHeight(): void {
Slides.style( 'height', cssSlideHeight(), true );
Slides.style( 'height', cssSlideHeight() || null, true );
}

/**
Expand Down
7 changes: 7 additions & 0 deletions src/js/test/php/examples/autoHeight.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@
autoHeight: true,
gap : '1rem',
trimSpace : 'move',
focus : 'center',
} );

splide.mount();
} );
</script>

<style>
.splide__slide {
overflow: hidden;
}
</style>
</head>
<body>

Expand Down

0 comments on commit b3a127b

Please sign in to comment.