From 09f55cf42a35f2c484c5b7141fb06e626dbcc66e Mon Sep 17 00:00:00 2001 From: Razvan Stoenescu Date: Tue, 17 Oct 2023 18:52:14 +0300 Subject: [PATCH] fix(QScrollArea): bulletproof previous PR #16210 (#16211) --- ui/src/components/scroll-area/QScrollArea.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ui/src/components/scroll-area/QScrollArea.js b/ui/src/components/scroll-area/QScrollArea.js index 7c57c3d8fdc..690ed284fe3 100644 --- a/ui/src/components/scroll-area/QScrollArea.js +++ b/ui/src/components/scroll-area/QScrollArea.js @@ -352,14 +352,26 @@ export default createComponent({ targetRef.value[ dirProps[ axis ].scroll ] = offset } + let mouseEventTimer = null + function onMouseenter () { - // setTimeout needed for iOS, see #16210 - setTimeout(() => { + if (mouseEventTimer !== null) { + clearTimeout(mouseEventTimer) + } + + // setTimeout needed for iOS; see ticket #16210 + mouseEventTimer = setTimeout(() => { + mouseEventTimer = null hover.value = true }, proxy.$q.platform.is.ios ? 50 : 0) } function onMouseleave () { + if (mouseEventTimer !== null) { + clearTimeout(mouseEventTimer) + mouseEventTimer = null + } + hover.value = false }