#49 : Add tappable event handlers

This commit is contained in:
Vadim
2021-07-24 16:16:23 +03:00
parent da7d8ac705
commit e837e09789
5 changed files with 58 additions and 6 deletions

View File

@@ -7,6 +7,7 @@
import { NEXT, PREV } from '../../direction'
import { swipeable } from '../../actions/swipeable'
import { focusable } from '../../actions/focusable'
import { tappable } from '../../actions/tappable'
import {
addResizeEventListener,
removeResizeEventListener
@@ -292,9 +293,13 @@
function handleSwipeEnd() {
showPage(currentPageIndex)
}
function handleFocused(event) {
focused = event.detail.value
}
function handleTapped() {
focused = !focused
}
</script>
<div class="sc-carousel__carousel-container">
@@ -315,6 +320,9 @@
bind:this={pageWindowElement}
use:focusable
on:focused={handleFocused}
use:tappable
on:tapped={handleTapped}
>
<div
class="sc-carousel__pages-container"