Skip to content

Commit

Permalink
Bug Fix: #550
Browse files Browse the repository at this point in the history
  • Loading branch information
NaotoshiFujita committed Dec 3, 2021
1 parent 4053202 commit 815030f
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 25 deletions.
9 changes: 0 additions & 9 deletions .editorconfig

This file was deleted.

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.6.8
* Version : 3.6.9
* License : MIT
* Copyright: 2021 Naotoshi Fujita
*/
Expand Down Expand Up @@ -1787,12 +1787,12 @@ function Drag(Splide2, Components2, options) {
const { noDrag } = options;
const isTouch = isTouchEvent(e);
const isDraggable = !noDrag || !matches(e.target, noDrag);
clickPrevented = false;
if (isDraggable && (isTouch || !e.button)) {
if (!Move.isBusy()) {
target = isTouch ? track : window;
prevBaseEvent = null;
lastEvent = null;
clickPrevented = false;
bind(target, POINTER_MOVE_EVENTS, onPointerMove, SCROLL_LISTENER_OPTIONS);
bind(target, POINTER_UP_EVENTS, onPointerUp, SCROLL_LISTENER_OPTIONS);
Move.cancel();
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.6.8
* Version : 3.6.9
* License : MIT
* Copyright: 2021 Naotoshi Fujita
*/
Expand Down Expand Up @@ -1783,12 +1783,12 @@ function Drag(Splide2, Components2, options) {
const { noDrag } = options;
const isTouch = isTouchEvent(e);
const isDraggable = !noDrag || !matches(e.target, noDrag);
clickPrevented = false;
if (isDraggable && (isTouch || !e.button)) {
if (!Move.isBusy()) {
target = isTouch ? track : window;
prevBaseEvent = null;
lastEvent = null;
clickPrevented = false;
bind(target, POINTER_MOVE_EVENTS, onPointerMove, SCROLL_LISTENER_OPTIONS);
bind(target, POINTER_UP_EVENTS, onPointerUp, SCROLL_LISTENER_OPTIONS);
Move.cancel();
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-lock.json

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

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.6.8",
"version": "3.6.9",
"description": "Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.",
"author": "Naotoshi Fujita",
"license": "MIT",
Expand Down
9 changes: 5 additions & 4 deletions src/js/components/Drag/Drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
const isTouch = isTouchEvent( e );
const isDraggable = ! noDrag || ! matches( e.target, noDrag );

clickPrevented = false;

if ( isDraggable && ( isTouch || ! e.button ) ) {
if ( ! Move.isBusy() ) {
target = isTouch ? track : window;
prevBaseEvent = null;
lastEvent = null;
clickPrevented = false;
target = isTouch ? track : window;
prevBaseEvent = null;
lastEvent = null;

bind( target, POINTER_MOVE_EVENTS, onPointerMove, SCROLL_LISTENER_OPTIONS );
bind( target, POINTER_UP_EVENTS, onPointerUp, SCROLL_LISTENER_OPTIONS );
Expand Down
4 changes: 4 additions & 0 deletions src/js/test/php/examples/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
} );

splide.mount();

// Array.from( document.getElementsByTagName( 'button' ) ).forEach( button => {
// button.addEventListener( 'click', () => alert( 'click' ) );
// } );
} );
</script>

Expand Down

0 comments on commit 815030f

Please sign in to comment.