Workshop › Klondike Solitaire › Step 25 of 40
Letting go of a held card moves it to where it fits, with autoMove. Now the game can be played with taps.
```js
document.addEventListener('pointerup', () => {
if (!drag) return
const { from, index } = drag
autoMove(from, index)
drag = null
})
```const { from, index } = drag takes the two values out of the object into two names.drag = null: nothing is held any more.Under the pointerdown listener (after its })), leave an empty line and write the pointerup listener. Run and play by
tapping cards.
Skills: Keyboard and mouse input
← Pick up a card A move counter →