refactor: pane gesture overlay animation

This commit is contained in:
Aman Harwara
2023-02-10 15:06:08 +05:30
parent 9fcaed4395
commit 7c84b77a62

View File

@@ -62,9 +62,21 @@ export const usePaneSwipeGesture = (
requestElementUpdate(0) requestElementUpdate(0)
} }
overlayElementRef.current?.remove() if (overlayElementRef.current) {
overlayElementRef.current
.animate([{ opacity: 0 }], {
duration: 5,
fill: 'forwards',
})
.finished.then(() => {
if (overlayElementRef.current) {
overlayElementRef.current.remove()
overlayElementRef.current = null overlayElementRef.current = null
} }
})
.catch(console.error)
}
}
} }
function requestElementUpdate(x: number) { function requestElementUpdate(x: number) {