Skip to content

Commit 32550b6

Browse files
authored
Merge pull request #17 from TedDriggs/show-thumb-with-permanent-track
Show thumb when permanent tracks enabled
2 parents 9e9993e + 221f4d5 commit 32550b6

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,15 +713,15 @@ export default class Scrollbar extends React.Component
713713
if ((permanentScrollbars || permanentScrollbarY)) {
714714
trackVerticalStyles.display = null;
715715

716-
if (noScroll || !scrollY) {
716+
if (noScroll || noScrollY) {
717717
thumbVerticalStyles.display = "none";
718718
}
719719
}
720720

721721
if ((permanentScrollbars || permanentScrollbarX)) {
722722
trackHorizontalStyles.display = null;
723723

724-
if (noScroll || !scrollX) {
724+
if (noScroll || noScrollX) {
725725
thumbHorizontalStyles.display = "none";
726726
}
727727
}

tests/Scrollbar/rendering.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,23 @@ export default function performTests() {
343343
});
344344
});
345345

346+
describe("when always showing scrollbars", () => {
347+
it("should render thumb when content taller than viewport", (done) => {
348+
render(<Scrollbar style={{ width: 100, height: 100 }} permanentScrollbarY>
349+
<div style={{width: 100, height: 200}} />
350+
</Scrollbar>,
351+
node,
352+
function() {
353+
setTimeout(() => {
354+
expect(this.trackVertical.style.display).not.toBe("none");
355+
expect(this.thumbVertical.style.display).not.toBe("none");
356+
done();
357+
}, 100);
358+
}
359+
);
360+
});
361+
})
362+
346363
describe("only vertical scroll should be blocked", () => {
347364
it("if noScrollY={ true } is passed", (done) => {
348365
render(<Scrollbar style={ {width: 100, height: 100} } noScrollY={ true }>

0 commit comments

Comments
 (0)