Skip to content

box滚动条计算错误bug #19

@FengLin2016

Description

@FengLin2016

问题:由于内容区域太高,触发了滑块的最小值就会出现问题,滑块拖动到最后,但是内容不是最后!
代码:
`
const scrollRatioY = this.scrollRatioY = scrollYBounds.height / contentBounds.height

`
这里计算比例 如果触发最小值 就会减少块实际可滑动距离,造成问题。

建议修改为:可滑动距离/内容区域高度-可视区域高度

const scrollRatioY = this.scrollRatioY = (scrollYBounds.height - (Math.max(scrollYBounds.height * ratioY, minSize))) / (contentBounds.height - viewportBounds.height)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions