Skip to content

Commit

Permalink
chore: include the fix for quasarframework#17206
Browse files Browse the repository at this point in the history
  • Loading branch information
thexeos committed May 18, 2024
1 parent d9e2a5f commit 4e7b9e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/src/components/scroll-area/QScrollAreaControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { dirProps } from './use-scroll-area.js'
import TouchPan from '../../directives/touch-pan/TouchPan.js'

import { createComponent } from '../../utils/private.create/create.js'
import { between } from '../../utils/format.js'

const panOpts = {
prevent: true,
Expand Down Expand Up @@ -90,8 +91,9 @@ export default createComponent({
if (data.thumbHidden.value !== true) {
const offset = evt[ dirProps[ axis ].offset ]
if (offset < data.thumbStart.value || offset > data.thumbStart.value + data.thumbSize.value) {
const pos = offset - data.thumbSize.value / 2
setScroll(pos / props.container[ axis ].value * data.size.value, axis)
const targetThumbStart = offset - data.thumbSize.value / 2
const percentage = between(targetThumbStart / (props.container[ axis ].value - data.thumbSize.value), 0, 1)
setScroll(percentage * Math.max(0, data.size.value - props.container[ axis ].value), axis)
}

// activate thumb pan
Expand Down

0 comments on commit 4e7b9e8

Please sign in to comment.