refactor: pane gesture overlay animation
This commit is contained in:
@@ -62,8 +62,20 @@ export const usePaneSwipeGesture = (
|
|||||||
requestElementUpdate(0)
|
requestElementUpdate(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
overlayElementRef.current?.remove()
|
if (overlayElementRef.current) {
|
||||||
overlayElementRef.current = null
|
overlayElementRef.current
|
||||||
|
.animate([{ opacity: 0 }], {
|
||||||
|
duration: 5,
|
||||||
|
fill: 'forwards',
|
||||||
|
})
|
||||||
|
.finished.then(() => {
|
||||||
|
if (overlayElementRef.current) {
|
||||||
|
overlayElementRef.current.remove()
|
||||||
|
overlayElementRef.current = null
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(console.error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user