Skip to content

Commit

Permalink
momentum scrolling config;
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Oct 18, 2018
1 parent 420d84c commit 1353670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* `fallbackScrollbarWidth`: _(number)_ Number of pixels that will be treated as scrollbar width if automated scrollbar width detection will fail. _This parameter used on mobiles, because scrollbars there has an absolute positioning and can't be measured._ _(default: 20)_
* `minimalThumbsSize`: _(number)_ Minimal size of thumb in pixels _(default: 30)_
* `rtl`: _(boolean)_ Override the direction style parameter _(default: undefined)_
* `momentum`: _(boolean)_ Whether to use momentum scrolling on iOS _(default: true)_
* `noScroll`: _(boolean)_ Disable both vertical and horizontal scrolling _(default: false)_
* `noScrollY`: _(boolean)_ Disable vertical scrolling _(default: false)_
* `noScrollX`: _(boolean)_ Disable horizontal scrolling _(default: false)_
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default class Scrollbar extends React.Component
minimalThumbsSize: PropTypes.number,
fallbackScrollbarWidth: PropTypes.number,

rtl: PropTypes.bool,
momentum: PropTypes.bool,
defaultStyles: PropTypes.bool,

permanentScrollbars: PropTypes.bool,
Expand Down Expand Up @@ -593,7 +595,7 @@ export default class Scrollbar extends React.Component
minimalThumbsSize, fallbackScrollbarWidth, scrollDetectionThreshold,

// boolean props
defaultStyles, noScroll, noScrollX, noScrollY, permanentScrollbars, permanentScrollbarX, permanentScrollbarY, rtl,
defaultStyles, noScroll, noScrollX, noScrollY, permanentScrollbars, permanentScrollbarX, permanentScrollbarY, rtl, momentum = true,

// holder element props
tagName, children, style, className,
Expand Down Expand Up @@ -653,6 +655,7 @@ export default class Scrollbar extends React.Component
overflowY: "scroll",
marginBottom: -(browserScrollbarWidth || fallbackScrollbarWidth),
paddingBottom: (browserScrollbarWidth ? null : fallbackScrollbarWidth),
...(momentum && {WebkitOverflowScrolling: "touch"}),
},
trackVerticalStyles = {
...trackVerticalStyle,
Expand Down

0 comments on commit 1353670

Please sign in to comment.