ngx-scrollbar icon indicating copy to clipboard operation
ngx-scrollbar copied to clipboard

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

Open meowhunter opened this issue 1 year ago • 6 comments

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

  • Angular: 16.1.5
  • ngx-scrollbar: 13.0.2
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

meowhunter avatar Jan 10 '24 16:01 meowhunter

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

MurhafSousli avatar Jan 10 '24 16:01 MurhafSousli

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

meowhunter avatar Jan 10 '24 16:01 meowhunter

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?

MurhafSousli avatar Jan 28 '24 12:01 MurhafSousli

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

meowhunter avatar Jan 29 '24 07:01 meowhunter

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?

MurhafSousli avatar Jan 29 '24 19:01 MurhafSousli

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

Yep, that`s what i need

meowhunter avatar Jan 29 '24 21:01 meowhunter

This should be fixed in v14

MurhafSousli avatar Feb 17 '24 13:02 MurhafSousli

Thank you very much

meowhunter avatar Feb 17 '24 16:02 meowhunter