Compare commits

...
Author SHA1 Message Date
tdgao 5bb1293e0b fix: analytics tooltip not pinned after mobile chart drag 2026-07-14 10:15:31 -07:00
2 changed files with 13 additions and 8 deletions
@@ -775,19 +775,22 @@ function suppressUpcomingChartClick() {
}, 350)
}
function clearUnpinnedTouchInteraction(ignoreClick: boolean) {
function clearUnpinnedTouchInteraction(ignoreClick: boolean, pinHover = false) {
if (props.pinnedSliceIndex !== null) return
if (ignoreClick) {
suppressUpcomingChartClick()
}
if (pinHover) {
emit('touch-drag')
}
clearChartActiveState()
updateChartWithoutGeometry()
if (ignoreClick) {
suppressUpcomingChartClick()
emit('touch-drag')
return
if (!pinHover) {
emit('hover', { visible: false, x: 0, y: 0, sliceIndex: null })
}
emit('hover', { visible: false, x: 0, y: 0, sliceIndex: null })
}
function handleCanvasClickCapture(event: MouseEvent) {
@@ -918,7 +921,7 @@ function handleRangePointerEnd(event: PointerEvent) {
if (isRangeSelecting && rangeSelectPointerType === 'touch') {
event.preventDefault()
clearUnpinnedTouchInteraction(true)
clearUnpinnedTouchInteraction(true, true)
} else if (isRangeSelecting && startSliceIndex !== null && endSliceIndex !== null) {
event.preventDefault()
emit('range-select', { startSliceIndex, endSliceIndex })
@@ -110,6 +110,8 @@ export function useAnalyticsChartInteractions({
function onTouchDragEnd() {
ignoreUpcomingChartClick()
if (!hoverState.visible || hoverState.sliceIndex === null) return
isHoverPinned.value = true
}
function onChartGeometry(payload: AnalyticsChartGeometryPayload) {