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

Fixed thumb size calculation when track height is not equal to content height #381

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mdudek
Copy link

@mdudek mdudek commented Sep 15, 2021

Description

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@@ -72,6 +72,7 @@ export class ScrollbarTrack implements I.ScrollbarTrack {
display: pageSize <= containerSize ? 'none' : 'block',
});

this.thumb.update(scrollOffset, containerSize, pageSize);
const trackHeightOffset = (this.direction === TrackDirection.Y ? this.element.offsetHeight : this.element.offsetWidth) - containerSize;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For cases when scrollbar height/width is not equal to scrollable area size, e.g.

dialog_layout

Copy link
Owner

@idiotWu idiotWu Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I think the thumb size would be trackSize / pageSize in that case, so leaving the 3rd parameter as pageSize is enough (the next line). Have you tested it?

PS: and the 2nd parameter should be the track's size

@idiotWu
Copy link
Owner

idiotWu commented Sep 17, 2021

Let's leave this PR open as it's not the expected behavior of a standard scrollbar. I'll consider whether to merge it or not in the next major release.

@katsar0v
Copy link

Any updates? It should be expected behavior that one wants to adjust the height of the track and scrollbar...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants