Skip to content

Decimal size value on element size causing scrollbar unnecessarily appearing #172

@sabdol

Description

@sabdol

After 1.5.6 update, when browser is zoomed in or out to 90% or 110%, scrollbar is appearing where it does not have to.

This seems due to 1.5.6 update contains

    i.containerWidth = Math.floor(rect.width);
    i.containerHeight = Math.floor(rect.height);

this 2 lines change.

The scroller active status was determined by comparing i.containerWidth/Height and i.contentWidth/Height.

Due to using Math.floor instead of round causing the issue as when the value is like 559.99 is the size of element,

i.container size becomes 599 due to floor. while i.content size will be 600 as Chrome round the value when doing element.scrollHeight.

Now container is recognised as smaller then contents and scrollbar appearing, which is wrong.

Image

Tested on: Chrome Version 137.0.7151.120 (Official Build) (arm64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions