Closed ataylor32 closed 4 years ago
Good idea, thanks!
Do you know when this might be added? Is there anything I can do to help?
Hi I am spending all day to port my code to React and once it's done I'll release it along with the change you've requested (hopefully today but I'm currently facing one last tough bug with the React port)
Thanks! In order to get this working properly on my project, I had to remove the following from onScrollResize
:
this.DOM.scope.classList.toggle('fakeScroll--hasBar', this.state.scrollRatio < 1)
I then added the following to moveBar
at the same point where this.DOM.bar.style.cssText
gets set:
if (scrollHeight <= ownHeight) {
this.DOM.scope.classList.remove('fakeScroll--hasBar');
}
else {
this.DOM.scope.classList.add('fakeScroll--hasBar');
}
Why did you remove it? moveBar
is not the place for it.
You should not change the source code or you'll be out-of-sync with future updates...
You can look at #18 for context. I couldn't get that to work correctly without the change I mentioned in my previous comment. moveBar
seemed like an appropriate place for it because that's where the .fakeScroll__bar
div gets display: none
added or removed.
When no scrolling is necessary, the
.fakeScroll__bar
div is hidden withdisplay: none
. This is good, but I think it would also be good if the.fakeScroll__track
div was given a class like.fakeScroll__has_hidden_bar
or something along those lines so that developers could more easily update the styling of the track when there is nothing to scroll.