Skip to content

Commit

Permalink
fix(QScrollArea): bulletproof previous PR #16210 (#16211)
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Oct 17, 2023
1 parent 5932322 commit 09f55cf
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ui/src/components/scroll-area/QScrollArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 09f55cf

Please sign in to comment.