Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ npm i react-native-sortable-list --save
- **contentContainerStyle?** (Object, Array) these styles will be applied to the inner scroll view content container
- **innerContainerStyle?** (Object, Array) these styles will be applied to the inner scroll view content container, excluding the header and footer
- **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.
- **showsVerticalScrollIndicator** (boolean) when false, the vertical scroll indicator will not be visible. The default value is true.
- **showsHorizontalScrollIndicator** (boolean) when false, the horizontal scroll indicator will not be visible. The default value is true.
- **sortingEnabled?** (boolean) when false, rows are not sortable. The default value is true.
- **scrollEnabled?** (boolean) when false, the content does not scrollable. The default value is true.
- **manuallyActivateRows?** (bool) whether you intend to use the `toggleRowActive` method to activate a row or use the out of box solution.
Expand Down
10 changes: 8 additions & 2 deletions src/SortableList.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default class SortableList extends Component {
sortingEnabled: PropTypes.bool,
scrollEnabled: PropTypes.bool,
horizontal: PropTypes.bool,
showsVerticalScrollIndicator: PropTypes.bool,
showsHorizontalScrollIndicator: PropTypes.bool,
refreshControl: PropTypes.element,
autoscrollAreaSize: PropTypes.number,
rowActivationTime: PropTypes.number,
Expand All @@ -41,7 +43,9 @@ export default class SortableList extends Component {
sortingEnabled: true,
scrollEnabled: true,
autoscrollAreaSize: 60,
manuallyActivateRows: false
manuallyActivateRows: false,
showsVerticalScrollIndicator: true,
showsHorizontalScrollIndicator: true
}

/**
Expand Down Expand Up @@ -180,7 +184,7 @@ export default class SortableList extends Component {
}

render() {
let {contentContainerStyle, innerContainerStyle, horizontal, style} = this.props;
let {contentContainerStyle, innerContainerStyle, horizontal, style, showsVerticalScrollIndicator, showsHorizontalScrollIndicator} = this.props;
const {animated, contentHeight, contentWidth, scrollEnabled} = this.state;
const containerStyle = StyleSheet.flatten([style, {opacity: Number(animated)}])
innerContainerStyle = [
Expand All @@ -205,6 +209,8 @@ export default class SortableList extends Component {
contentContainerStyle={contentContainerStyle}
scrollEventThrottle={2}
scrollEnabled={scrollEnabled}
showsHorizontalScrollIndicator={showsHorizontalScrollIndicator}
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
onScroll={this._onScroll}>
{this._renderHeader()}
<View style={innerContainerStyle}>
Expand Down