#56 : Fix touchable handlers

This commit is contained in:
Vadim
2021-08-16 09:46:35 +03:00
parent efdca46391
commit 4e6f37ca91
6 changed files with 17 additions and 94 deletions

View File

@@ -6,7 +6,8 @@
import Progress from '../Progress/Progress.svelte'
import { NEXT, PREV } from '../../direction'
import { swipeable } from '../../actions/swipeable'
import { pausable } from '../../actions/pausable'
import { focusable } from '../../actions/focusable'
import { tappable } from '../../actions/tappable'
import {
addResizeEventListener,
removeResizeEventListener
@@ -310,13 +311,12 @@
await offsetPage({ animated: true })
}
function handlePausedToggle(event) {
if (event.detail.isTouchable) {
focused = !focused
return
}
function handleFocused(event) {
focused = event.detail.value
}
}
function handleTapped(event) {
focused = !focused
}
</script>
<div class="sc-carousel__carousel-container">
@@ -336,8 +336,11 @@
class="sc-carousel__pages-window"
bind:this={pageWindowElement}
use:pausable
on:pausedToggle={handlePausedToggle}
use:focusable
on:focused={handleFocused}
use:tappable
on:tapped={handleTapped}
>
<div
class="sc-carousel__pages-container"