Merge branch 'main' into feature/#49-Update-focus-event-for-touch

This commit is contained in:
Vadim
2021-08-06 19:40:11 +03:00
10 changed files with 50 additions and 15 deletions

View File

@@ -91,6 +91,11 @@
*/
export let dots = true
/**
* Enable swiping
*/
export let swiping = true
export async function goTo(pageIndex, options) {
const animated = get(options, 'animated', true)
if (typeof pageIndex !== 'number') {
@@ -283,15 +288,19 @@
// gestures
function handleSwipeStart() {
if (!swiping) return
_duration = 0
}
async function handleThreshold(event) {
if (!swiping) return
await directionFnDescription[event.detail.direction]()
}
function handleSwipeMove(event) {
if (!swiping) return
offset += event.detail.dx
}
function handleSwipeEnd() {
if (!swiping) return
showPage(currentPageIndex)
}