diff --git a/src/views/appComponents/Tooltip.vue b/src/views/appComponents/Tooltip.vue index 404277a..5f6c5b8 100644 --- a/src/views/appComponents/Tooltip.vue +++ b/src/views/appComponents/Tooltip.vue @@ -12,26 +12,20 @@ - - - + {{ text }} + + @@ -55,8 +49,10 @@ const triggerRef = ref(null); const tipRef = ref(null); const visible = ref(false); + const positioned = ref(false); const isListening = ref(false); const timer = ref(null); + const revealFrame = ref(null); const gap = 10; const viewportPadding = 8; @@ -83,6 +79,13 @@ } }; + const clearRevealFrame = () => { + if (revealFrame.value) { + window.cancelAnimationFrame(revealFrame.value); + revealFrame.value = null; + } + }; + const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max); const addPositionListeners = () => { @@ -104,21 +107,29 @@ if (visible.value) { calculatePosition(); + positioned.value = true; return; } clearTimer(); timer.value = window.setTimeout(async () => { timer.value = null; + positioned.value = false; visible.value = true; await nextTick(); calculatePosition(); + revealFrame.value = window.requestAnimationFrame(() => { + positioned.value = true; + revealFrame.value = null; + }); addPositionListeners(); }, props.delay); }; const hideTip = () => { clearTimer(); + clearRevealFrame(); + positioned.value = false; visible.value = false; removePositionListeners(); }; diff --git a/src/views/appComponents/WinCustomer.vue b/src/views/appComponents/WinCustomer.vue index 431cdc8..21be4d7 100644 --- a/src/views/appComponents/WinCustomer.vue +++ b/src/views/appComponents/WinCustomer.vue @@ -19,7 +19,9 @@ {{ index + 1 }}