Skip to content

Commit d494d2f

Browse files
junyuanxuegitim
authored andcommitted
Adding hide scroll indicator props (#84)
* adding hide scroll indicator props * proptypes and readme
1 parent 8883239 commit d494d2f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ npm i react-native-sortable-list --save
3131
- **contentContainerStyle?** (Object, Array) these styles will be applied to the inner scroll view content container
3232
- **innerContainerStyle?** (Object, Array) these styles will be applied to the inner scroll view content container, excluding the header and footer
3333
- **horizontal?** (boolean) when true, the SortableList's children are arranged horizontally in a row instead of vertically in a column. The default value is false.
34+
- **showsVerticalScrollIndicator** (boolean) when false, the vertical scroll indicator will not be visible. The default value is true.
35+
- **showsHorizontalScrollIndicator** (boolean) when false, the horizontal scroll indicator will not be visible. The default value is true.
3436
- **sortingEnabled?** (boolean) when false, rows are not sortable. The default value is true.
3537
- **scrollEnabled?** (boolean) when false, the content does not scrollable. The default value is true.
3638
- **manuallyActivateRows?** (bool) whether you intend to use the `toggleRowActive` method to activate a row or use the out of box solution.

Diff for: src/SortableList.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export default class SortableList extends Component {
2323
sortingEnabled: PropTypes.bool,
2424
scrollEnabled: PropTypes.bool,
2525
horizontal: PropTypes.bool,
26+
showsVerticalScrollIndicator: PropTypes.bool,
27+
showsHorizontalScrollIndicator: PropTypes.bool,
2628
refreshControl: PropTypes.element,
2729
autoscrollAreaSize: PropTypes.number,
2830
rowActivationTime: PropTypes.number,
@@ -41,7 +43,9 @@ export default class SortableList extends Component {
4143
sortingEnabled: true,
4244
scrollEnabled: true,
4345
autoscrollAreaSize: 60,
44-
manuallyActivateRows: false
46+
manuallyActivateRows: false,
47+
showsVerticalScrollIndicator: true,
48+
showsHorizontalScrollIndicator: true
4549
}
4650

4751
/**
@@ -180,7 +184,7 @@ export default class SortableList extends Component {
180184
}
181185

182186
render() {
183-
let {contentContainerStyle, innerContainerStyle, horizontal, style} = this.props;
187+
let {contentContainerStyle, innerContainerStyle, horizontal, style, showsVerticalScrollIndicator, showsHorizontalScrollIndicator} = this.props;
184188
const {animated, contentHeight, contentWidth, scrollEnabled} = this.state;
185189
const containerStyle = StyleSheet.flatten([style, {opacity: Number(animated)}])
186190
innerContainerStyle = [
@@ -205,6 +209,8 @@ export default class SortableList extends Component {
205209
contentContainerStyle={contentContainerStyle}
206210
scrollEventThrottle={2}
207211
scrollEnabled={scrollEnabled}
212+
showsHorizontalScrollIndicator={showsHorizontalScrollIndicator}
213+
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
208214
onScroll={this._onScroll}>
209215
{this._renderHeader()}
210216
<View style={innerContainerStyle}>

0 commit comments

Comments
 (0)