Fix dragging state not reset

This commit is contained in:
the1812 2023-09-06 09:18:39 +08:00
parent 147693b7d7
commit 81150a5c10

View File

@ -70,14 +70,14 @@ const startDragging = (e: PointerEvent) => {
document.documentElement.classList.remove('custom-width-dragging')
document.documentElement.style.cursor = ''
document.documentElement.removeEventListener('pointermove', handlePointerMove)
isDragging.value = false
startPoint.value = 0
if (!movement.value) {
return
}
movement.value = 0
const newWidth = previewWidth.value
options.customWidth = newWidth
isDragging.value = false
startPoint.value = 0
movement.value = 0
document.documentElement.style.setProperty('--live-chat-panel-width', `${newWidth}px`)
},
{ once: true },