Skip to content

Commit

Permalink
Critical bug fixed (wrong classnames was assigned);
Browse files Browse the repository at this point in the history
Added overflow: hidden; to tracks;
  • Loading branch information
xobotyi committed Oct 19, 2018
1 parent 026478f commit de09362
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
20 changes: 11 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ var defaultElementsStyles = {
top: 0,
margin: "8px 0",
background: "rgba(0,0,0,.1)",
borderRadius: 4
borderRadius: 4,
overflow: "hidden"
},
trackHorizontal: {
position: "absolute",
Expand All @@ -80,7 +81,8 @@ var defaultElementsStyles = {
left: 0,
margin: "0 8px",
background: "rgba(0,0,0,.1)",
borderRadius: 4
borderRadius: 4,
overflow: "hidden"
},
thumbVertical: {
cursor: "pointer",
Expand Down Expand Up @@ -578,13 +580,13 @@ function (_React$Component) {
props = _objectWithoutProperties(_this$props2, ["minimalThumbsSize", "fallbackScrollbarWidth", "scrollDetectionThreshold", "defaultStyles", "noScroll", "noScrollX", "noScrollY", "permanentScrollbars", "permanentScrollbarX", "permanentScrollbarY", "rtl", "momentum", "tagName", "children", "style", "className", "wrapperStyle", "contentStyle", "trackVerticalStyle", "trackHorizontalStyle", "thumbVerticalStyle", "thumbHorizontalStyle", "wrapperClassName", "contentClassName", "trackVerticalClassName", "trackHorizontalClassName", "thumbVerticalClassName", "thumbHorizontalClassName", "onScroll", "onScrollStart", "onScrollStop", "renderWrapper", "renderContent", "renderTrackVertical", "renderTrackHorizontal", "renderThumbVertical", "renderThumbHorizontal"]);

var browserScrollbarWidth = (0, _utilities.getScrollbarWidth)();
var holderClassNames = "ScrollbarsCustom-holder" + (className && " " + className),
wrapperClassNames = "ScrollbarsCustom-wrapper" + (wrapperClassName && " " + wrapperClassName),
contentClassNames = "ScrollbarsCustom-content" + (contentClassName && " " + contentClassName),
trackVerticalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackVertical" + (trackVerticalClassName && " " + trackVerticalClassName),
trackHorizontalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackHorizontal" + (trackHorizontalClassName && " " + trackHorizontalClassName),
thumbVerticalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (thumbVerticalClassName && " " + thumbVerticalClassName),
thumbHorizontalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (thumbHorizontalClassName && " " + thumbHorizontalClassName);
var holderClassNames = "ScrollbarsCustom-holder" + (!!className ? " " + className : ""),
wrapperClassNames = "ScrollbarsCustom-wrapper" + (!!wrapperClassName ? " " + wrapperClassName : ""),
contentClassNames = "ScrollbarsCustom-content" + (!!contentClassName ? " " + contentClassName : ""),
trackVerticalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackVertical" + (!!trackVerticalClassName ? " " + trackVerticalClassName : ""),
trackHorizontalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackHorizontal" + (!!trackHorizontalClassName ? " " + trackHorizontalClassName : ""),
thumbVerticalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (!!thumbVerticalClassName ? " " + thumbVerticalClassName : ""),
thumbHorizontalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (!!thumbHorizontalClassName ? " " + thumbHorizontalClassName : "");

var holderStyles = _objectSpread({}, style, defaultStyles && defaultElementsStyles.holder, {
direction: rtl === true && "rtl" || rtl === false && "ltr" || null
Expand Down
3 changes: 3 additions & 0 deletions examples/app/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ body {
display: block;
background: #D0D3D7;
border-radius: 1rem;
overflow: hidden;

&.ScrollbarsCustom-trackVertical {
height: calc(100% - 2rem);
Expand Down Expand Up @@ -377,6 +378,7 @@ body {
width: 8px;
background: rgba(0, 0, 0, 0.1);
grid-area: 1 / 2 / auto / auto;
overflow: hidden;

& > .ScrollbarsCustom-thumb {
cursor: pointer;
Expand Down Expand Up @@ -450,6 +452,7 @@ body {
width: 8px;
background: rgba(0, 0, 0, 0.1);
grid-area: 1 / 2 / auto / auto;
overflow: hidden;

& > .ScrollbarsCustom-thumb {
cursor: pointer;
Expand Down
16 changes: 9 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const defaultElementsStyles = {
margin: "8px 0",
background: "rgba(0,0,0,.1)",
borderRadius: 4,
overflow: "hidden",
},
trackHorizontal: {
position: "absolute",
Expand All @@ -42,6 +43,7 @@ const defaultElementsStyles = {
margin: "0 8px",
background: "rgba(0,0,0,.1)",
borderRadius: 4,
overflow: "hidden",
},
thumbVertical: {
cursor: "pointer",
Expand Down Expand Up @@ -637,13 +639,13 @@ export default class Scrollbar extends React.Component

const browserScrollbarWidth = getScrollbarWidth();

const holderClassNames = "ScrollbarsCustom-holder" + (className && (" " + className)),
wrapperClassNames = "ScrollbarsCustom-wrapper" + (wrapperClassName && (" " + wrapperClassName)),
contentClassNames = "ScrollbarsCustom-content" + (contentClassName && (" " + contentClassName)),
trackVerticalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackVertical" + (trackVerticalClassName && (" " + trackVerticalClassName)),
trackHorizontalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackHorizontal" + (trackHorizontalClassName && (" " + trackHorizontalClassName)),
thumbVerticalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (thumbVerticalClassName && (" " + thumbVerticalClassName)),
thumbHorizontalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (thumbHorizontalClassName && (" " + thumbHorizontalClassName));
const holderClassNames = "ScrollbarsCustom-holder" + (!!className ? (" " + className) : ""),
wrapperClassNames = "ScrollbarsCustom-wrapper" + (!!wrapperClassName ? (" " + wrapperClassName) : ""),
contentClassNames = "ScrollbarsCustom-content" + (!!contentClassName ? (" " + contentClassName) : ""),
trackVerticalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackVertical" + (!!trackVerticalClassName ? (" " + trackVerticalClassName) : ""),
trackHorizontalClassNames = "ScrollbarsCustom-track ScrollbarsCustom-trackHorizontal" + (!!trackHorizontalClassName ? (" " + trackHorizontalClassName) : ""),
thumbVerticalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (!!thumbVerticalClassName ? (" " + thumbVerticalClassName) : ""),
thumbHorizontalClassNames = "ScrollbarsCustom-thumb ScrollbarsCustom-thumbHorizontal" + (!!thumbHorizontalClassName ? (" " + thumbHorizontalClassName) : "");

const holderStyles = {
...style,
Expand Down

0 comments on commit de09362

Please sign in to comment.