Skip to content

Commit

Permalink
fix(DashboardChartSummary): tooltip closed after pointer up on `m…
Browse files Browse the repository at this point in the history
…obile`

See: e9f9ba9
  • Loading branch information
marcel-bitfly committed Dec 9, 2024
1 parent 4d30707 commit a2c00c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"BcPremiumModal",
"BcTablePager",
"BcToggle",
"DashboardChartSummary",
"DashboardChartSummaryFilter",
"DashboardGroupManagementModal",
"DashboardTableSummaryDetails",
Expand Down
11 changes: 5 additions & 6 deletions frontend/components/dashboard/chart/DashboardChartSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ const formatTimestamp = (value: string) => {
return date
}
}
const toogleTrigger = ref(false)
const isTriggeringOnMouseMove = ref(true)
const option = computed<EChartsOption>(() => {
return {
color: colors.value.groups,
Expand Down Expand Up @@ -371,7 +371,7 @@ const option = computed<EChartsOption>(() => {
order: 'seriesAsc',
padding: 0,
trigger: 'axis',
triggerOn: toogleTrigger.value ? 'click' : 'mousemove|click',
triggerOn: isTriggeringOnMouseMove.value ? 'mousemove|click' : 'click',
},
xAxis: [
{
Expand Down Expand Up @@ -607,9 +607,8 @@ const onDatazoom = () => {
const onMouseMove = (e: MouseEvent) => {
lastMouseYPos = e.offsetY
}
const onMouseUp = () => {
// using mouseup event here, as `click` or `mousedown` would close `tooltip`
toogleTrigger.value = !toogleTrigger.value
const toggleTriggeringOnMouseMove = () => {
isTriggeringOnMouseMove.value = !isTriggeringOnMouseMove.value
}
</script>

Expand All @@ -624,7 +623,7 @@ const onMouseUp = () => {
class="chart"
:option
autoresize
@zr:mouseup="onMouseUp"
@zr:mousedown="toggleTriggeringOnMouseMove"
@datazoom="onDatazoom"
/>
<BcLoadingSpinner
Expand Down

0 comments on commit a2c00c2

Please sign in to comment.