Skip to content

Commit cdf2d90

Browse files
committed
docs;
1 parent e24fcf4 commit cdf2d90

File tree

8 files changed

+42
-17
lines changed

8 files changed

+42
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Native scrollbars on mobile devices
1818

1919
>**IMPORTANT:** default component styles uses [grid layout](https://developer.mozilla.org/docs/Web/CSS/CSS_Grid_Layout/Basic_Concepts_of_Grid_Layout) for proper scrollbars display.
20-
>But you can change it with help of [customisation](https://github.com/xobotyi/react-scrollbars-custom/tree/master/docs/CUSTOMISATION.md).
20+
>But you can change it by passing `gridless` parameter on initialisation.
2121
2222
## Installation
2323
```bash

docs/API.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
### `<Scrollbar>`
44
#### Properties
55
* **Setups**
6+
* `gridless`: _(boolean)_ Forces to use non-grid styles _(default: false)_
67
* `defaultStyles`: _(boolean)_ Apply default inline styles _(default: false)_
78
* `thumbSizeMin`: _(number)_ Minimal size of thumb in pixels _(default: 30)_
8-
* `scrollDetectionThreshold`: _(number)_ Scroll process check interval in milliseconds _(default: 100)_
9+
* `noScroll`: _(boolean)_ Disable both scrollings, vertical and horizontal _(default: false)_
10+
* `scrollY`: _(boolean)_ If false, vertical scrolling will be disabled _(default: true)_
11+
* `scrollX`: _(boolean)_ If false, horizontal scrolling will be disabled _(default: true)_
912
* `permanentScrollbars`: _(boolean)_ Display both, vertical and horizontal scrollbars permanently, in spite of scrolling possibility _(default: false)_
1013
* `permanentScrollbarVertical`: _(boolean)_ Display vertical scrollbar permanently, in spite of scrolling possibility _(default: false)_
1114
* `permanentScrollbarHorizontal`: _(boolean)_ Display horizontal scrollbar permanently, in spite of scrolling possibility _(default: false)_
15+
* `scrollDetectionThreshold`: _(number)_ Scroll process check interval in milliseconds _(default: 100)_
1216
* `contentSizeTrack`: _(boolean)_ Automatically check content's sizes to actualize the scrollbars. Useful when dom is changed not only by react. _(default: false)_
1317
* `contentSizeTrackInterval`: _(number)_ Interval between content's size check, in milliseconds _(default: 200)_
1418
* **Rendering**
@@ -29,8 +33,8 @@ All of these event handlers will be called inside the animation frame
2933
* `values.scrollLeft`: _(number)_ Native scrollLeft
3034
* `values.scrollHeight`: _(number)_ Native scrollHeight
3135
* `values.scrollWidth`: _(number)_ Native scrollWidth
32-
* `values.clientWidth`: _(number)_ Native clientWidth
33-
* `values.clientHeight`: _(number)_ Native clientHeight
36+
* `values.clientWidth`: _(number)_ Native clientWidth
37+
* `values.clientHeight`: _(number)_ Native clientHeight
3438
* `onUpdate (values)`: _(function)_ Called when the component is updated
3539
* `values`: _(object)_ Values representing scrolling position for the scroll start moment
3640
* `onScrollStart (values)`: _(function)_ Called when scrolling has started
@@ -51,4 +55,4 @@ All of these event handlers will be called inside the animation frame
5155
* `scrollToLeft()`: _(Scrollbar)_ Scroll to the left border
5256
* `scrollToRight()`: _(Scrollbar)_ Scroll to the right border
5357
* `update()`: _(Scrollbar)_ Updates the scrollbars. Useful when external, non-react libraries are changing scrollable content
54-
* `getScrollValues()`: _(object)_ Get values representing current scrolling position
58+
* `getScrollValues()`: _(object)_ Get values representing current scrolling position

docs/USAGE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ Component creates next structure:
3434
</div>
3535
```
3636

37+
### Scroll disabling
38+
The most common need is to disable scrolling fully or partially. You can do it simply adding `noScroll` to disable all scrolls and `scrollY={false}`/`scrollX={false}` to disable scrolls separately.
39+
Note, that if `scrollY={false}` and `scrollX={false}` will be set simultaneously, it will be treated like `noScroll={true}`.
40+
3741
### Default styles
38-
To customize scrollbars as you wish - you can turn off default styles.
42+
To customize scrollbars as you wish - you may want to turn off default styles.
3943
```javascript
4044
import React, { Component } from 'react';
4145
import Scrollbar from 'react-scrollbar-custom';
@@ -85,8 +89,8 @@ class App extends Component
8589
}
8690
```
8791

88-
### Automatic size checks
89-
It is possible that DOM will be changed not only with React: for these cases `<Scrollbar />` has automatic content checker.
92+
### Automatic size tracking
93+
It is possible that DOM will be changed not only with React: for these cases `<Scrollbar />` has automatic content tracker.
9094
```javascript
9195
import React, { Component } from 'react';
9296
import Scrollbar from 'react-scrollbar-custom';
@@ -100,4 +104,4 @@ class App extends Component
100104
}
101105
}
102106
```
103-
Now `<Scrollbar/>` will check content's sizes every 500ms and trigger `Scrollbar.update()` if they're changed.
107+
Now `<Scrollbar/>` will check content's sizes every 500ms and trigger `Scrollbar.update()` if they're changed.

examples/components/AutohideScrollbars/App.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/components/DefaultStyleScrollbars/App.js

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/static/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ body {
120120

121121
.scrollers .scroller > .description {
122122
display: block;
123+
position: relative;
123124
width: 100%;
124125
margin: 0 0 1.5rem;
125126
padding: 0 0 1rem;
@@ -246,4 +247,4 @@ body {
246247
#sandboxScrollbarsRoot .CustomScrollbar-thumbVertical:hover, #sandboxScrollbarsRoot .CustomScrollbar-thumbVertical.dragging {
247248
width: calc(100% + 2px);
248249
left: -1px;
249-
}
250+
}

src/Scrollbar/defaultElementStyle.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ export const holderGridless = {
5353
display: 'block',
5454
position: 'relative',
5555
};
56-
export const wrapperGridless = {};
56+
export const wrapperGridless = {
57+
display: 'block',
58+
minHeight: '100%',
59+
};
5760
export const trackVerticalGridless = {
5861
background: 'rgba(0,0,0,.1)',
5962
position: 'absolute',

src/Scrollbar/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,6 @@ export default class Scrollbar extends Component
664664
trackHorizontalStyle.display = 'none';
665665
}
666666

667-
console.log(contentStyle);
668-
669667
if ((permanentScrollbars || permanentScrollbarVertical)) {
670668
trackVerticalStyle.display = null;
671669

0 commit comments

Comments
 (0)