MurhafSousli / ngx-scrollbar

Custom overlay-scrollbars with native scrolling mechanism
https://ngx-scrollbar.netlify.app/
MIT License
618 stars 99 forks source link

Scrollbar-thumb width doesn`t recalculate after change of --scrollbar-padding #538

Closed meowhunter closed 9 months ago

meowhunter commented 10 months ago

Reproduction

It can be reproduced on demo page https://ngx-scrollbar.netlify.app/

Steps to reproduce:

  1. Open Styling options
  2. Change --scrollbar-padding value

Expected Behavior

Scrollbar-thumb width recalculated

Actual Behavior

Scrollbar-thumb width stays them same and recalculates only after scroll event or resize event

Environment

MurhafSousli commented 10 months ago

Is there a practical use case where you want to change the padding at runtime?

meowhunter commented 10 months ago

In my case i have a table with horizontal scroll, it stays fixed at the bottom of page and takes whole page, but if i scroll to the end of the table it become absolute and i need to shrink it a bit so it fits in the layout 2024-01-10_19-32-01

when it stops at the bottom i change --scrollbar-padding value 2024-01-10_19-33-40

MurhafSousli commented 9 months ago

Sorry, it is unclear to me, what happens when you scroll to the end? I cannot see an issue with the screenshot provided!

Can you explain what are you trying to accomplish?

meowhunter commented 9 months ago

Ok, what i want to accomplish is to dynamicly change width of scrollbar, problem is that it stays the same after i change --scrollbar-padding, and when i start scrolling it recalculates and scrollbar-thumb jumps to the side, than jumps back it looks glitchy. I tried to use update() method, but it didn`t help

MurhafSousli commented 9 months ago

Do you mean you want to dynamically change the scrollbar thickness? because if you are using the horizontal scrollbar, the width is the calculated length while the thickness is not calculated.

But anyway, I understand that you want the scrollbar to update when you change the --scrollbar-padding right?

meowhunter commented 9 months ago

But anyway, I understand that you want the scrollbar to update when you change the --scrollbar-padding right?

Yep, that`s what i need

MurhafSousli commented 9 months ago

This should be fixed in v14

meowhunter commented 9 months ago

Thank you very much