Skip to content

Commit

Permalink
Merge pull request #92 from apgsn/master
Browse files Browse the repository at this point in the history
Fix iOS 13 scrollbar bug with scrollIndicatorInsets prop
  • Loading branch information
mochixuan authored Nov 14, 2020
2 parents 9cf4681 + 4133644 commit ee72e78
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Example/app/widget/AutoDragSortableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ export default class AutoDragSortableView extends Component{
<ScrollView
bounces={false}
scrollEventThrottle={1}
scrollIndicatorInsets={this.props.scrollIndicatorInsets}
ref={(scrollRef)=> this.scrollRef = scrollRef}
scrollEnabled = {this.state.scrollEnabled}
onScroll={this.onScrollListener}
Expand Down Expand Up @@ -692,6 +693,12 @@ AutoDragSortableView.propTypes = {
autoThrottle: PropTypes.number,
autoThrottleDuration: PropTypes.number,
renderHeaderView: PropTypes.element,
scrollIndicatorInsets: PropTypes.shape({
top: PropTypes.number,
left: PropTypes.number,
bottom: PropTypes.number,
right: PropTypes.number,
}),
headerViewHeight: PropTypes.number,
renderBottomView: PropTypes.element,
bottomViewHeight: PropTypes.number,
Expand All @@ -713,6 +720,12 @@ AutoDragSortableView.defaultProps = {
slideDuration: 300,
autoThrottle: 2,
autoThrottleDuration: 10,
scrollIndicatorInsets: {
top: 0,
left: 0,
bottom: 0,
right: 1,
},
headerViewHeight: 0,
bottomViewHeight: 0,
}
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export { DragSortableView, AutoDragSortableView }
- **autoThrottleDuration**: PropTypes.number;
- **renderHeaderView**: PropTypes.element,
- **headerViewHeight**: PropTypes.number,
- **scrollIndicatorInsets**: PropTypes.shape({
top: PropTypes.number,
left: PropTypes.number,
bottom: PropTypes.number,
right: PropTypes.number
}),
- **renderBottomView**: PropTypes.element,
- **bottomViewHeight**: PropTypes.number,
Expand Down
13 changes: 13 additions & 0 deletions lib/AutoDragSortableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ export default class AutoDragSortableView extends Component{
<ScrollView
bounces={false}
scrollEventThrottle={1}
scrollIndicatorInsets={this.props.scrollIndicatorInsets}
ref={(scrollRef)=> this.scrollRef = scrollRef}
scrollEnabled = {this.state.scrollEnabled}
onScroll={this.onScrollListener}
Expand Down Expand Up @@ -692,6 +693,12 @@ AutoDragSortableView.propTypes = {
autoThrottle: PropTypes.number,
autoThrottleDuration: PropTypes.number,
renderHeaderView: PropTypes.element,
scrollIndicatorInsets: PropTypes.shape({
top: PropTypes.number,
left: PropTypes.number,
bottom: PropTypes.number,
right: PropTypes.number,
}),
headerViewHeight: PropTypes.number,
renderBottomView: PropTypes.element,
bottomViewHeight: PropTypes.number,
Expand All @@ -713,6 +720,12 @@ AutoDragSortableView.defaultProps = {
slideDuration: 300,
autoThrottle: 2,
autoThrottleDuration: 10,
scrollIndicatorInsets: {
top: 0,
left: 0,
bottom: 0,
right: 1,
},
headerViewHeight: 0,
bottomViewHeight: 0,
}
Expand Down
6 changes: 6 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export { DragSortableView, AutoDragSortableView }
- **autoThrottleDuration**: PropTypes.number;
- **renderHeaderView**: PropTypes.element,
- **headerViewHeight**: PropTypes.number,
- **scrollIndicatorInsets**: PropTypes.shape({
top: PropTypes.number,
left: PropTypes.number,
bottom: PropTypes.number,
right: PropTypes.number
}),
- **renderBottomView**: PropTypes.element,
- **bottomViewHeight**: PropTypes.number,
Expand Down
1 change: 1 addition & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface AutoIProps extends IProps {
autoThrottleDuration?: number,
renderHeaderView?: any,
headerViewHeight?: number,
scrollIndicatorInsets?: {top: number, left: number, bottom: number, right: number},
renderBottomView?: any,
bottomViewHeight?: number,
}
Expand Down

0 comments on commit ee72e78

Please sign in to comment.