From 413364453c49e8deb2051b793bc8c2a569b9e81f Mon Sep 17 00:00:00 2001 From: apgsn Date: Fri, 6 Nov 2020 10:45:51 +0100 Subject: [PATCH] Fix iOS 13 scrollbar bug with scrollIndicatorInsets prop --- Example/app/widget/AutoDragSortableView.js | 13 +++++++++++++ README.md | 6 ++++++ lib/AutoDragSortableView.js | 13 +++++++++++++ lib/README.md | 6 ++++++ lib/index.d.ts | 1 + 5 files changed, 39 insertions(+) diff --git a/Example/app/widget/AutoDragSortableView.js b/Example/app/widget/AutoDragSortableView.js index 14e4656..2a06a4b 100644 --- a/Example/app/widget/AutoDragSortableView.js +++ b/Example/app/widget/AutoDragSortableView.js @@ -588,6 +588,7 @@ export default class AutoDragSortableView extends Component{ this.scrollRef = scrollRef} scrollEnabled = {this.state.scrollEnabled} onScroll={this.onScrollListener} @@ -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, @@ -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, } diff --git a/README.md b/README.md index 8e678f7..ccfec8a 100644 --- a/README.md +++ b/README.md @@ -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, diff --git a/lib/AutoDragSortableView.js b/lib/AutoDragSortableView.js index 14e4656..2a06a4b 100644 --- a/lib/AutoDragSortableView.js +++ b/lib/AutoDragSortableView.js @@ -588,6 +588,7 @@ export default class AutoDragSortableView extends Component{ this.scrollRef = scrollRef} scrollEnabled = {this.state.scrollEnabled} onScroll={this.onScrollListener} @@ -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, @@ -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, } diff --git a/lib/README.md b/lib/README.md index 8e678f7..ccfec8a 100644 --- a/lib/README.md +++ b/lib/README.md @@ -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, diff --git a/lib/index.d.ts b/lib/index.d.ts index b5b99c1..802c78f 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -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, }