Diokuz / baron

Native scroll with custom scrollbar
MIT License
776 stars 124 forks source link

Content dimensions depending on `barOnCls` #184

Open andreyvolokitin opened 4 years ago

andreyvolokitin commented 4 years ago

I make a gap/padding in the content (using additional inner wrapper for that as suggested here) to accommodate scrollbars, but only if they are present (barOnCls is added), so in my css I add padding depending on presence of barOnCls. But after initialization the clipper height is set without this padding taken into account. I suspect (but not 100% sure yet), this is because content dimensions are read while this padding is not yet applied (barOnCls is added after dimensions are read)

What should be a proper solution for this: modifying the code so that dimensions a read after barOnCls is applied, or the gap for scrollbars should be added by different means (i.e. on the outer clipper element, because obviously scroller element can't take any padding)?

P.S.: I see this specifically with horizontal scrolling, not sure if it affects vertical scrolling as well, but I think it might not make any problem there

andreyvolokitin commented 4 years ago

Yep, clipper can't have padding either because of OS X FF.