fix(client): チャートのツールチップが画面に残ることがあるのを修正

Fix #9290
This commit is contained in:
syuilo 2022-12-28 13:15:31 +09:00
parent 55f923c674
commit f6b1f91cfa
2 changed files with 6 additions and 1 deletions

View file

@ -1,4 +1,4 @@
import { onUnmounted, ref } from 'vue';
import { onUnmounted, onDeactivated, ref } from 'vue';
import * as os from '@/os';
import MkChartTooltip from '@/components/MkChartTooltip.vue';
@ -24,6 +24,10 @@ export function useChartTooltip(opts: { position: 'top' | 'middle' } = { positio
if (disposeTooltipComponent) disposeTooltipComponent();
});
onDeactivated(() => {
tooltipShowing.value = false;
});
function handler(context) {
if (context.tooltip.opacity === 0) {
tooltipShowing.value = false;