Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: When the speed of moving the indicator is very slow, continuous … #1371

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/scroll-bar/src/indicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default class Indicator {

updatePosition(point: TranslaterPoint) {
const { pos, size } = this.caculatePosAndSize(point, this.scrollInfo)
this.refreshStyle(size, pos)
this.refreshStyle(size, Math.round(pos))
this.currentPos = pos
}

Expand All @@ -338,7 +338,7 @@ export default class Indicator {
const { sizeRatio, baseSize, maxScrollPos, minScrollPos } = scrollInfo
const minSize = this.options.minSize

let pos = Math.round(sizeRatio * point[posKey])
let pos = sizeRatio * point[posKey]
let size
// when out of boundary, slow down size reduction
if (pos < minScrollPos) {
Expand Down