From 3586d7042bda98812d9f469e1035fe054fbb0f84 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 30 May 2020 11:04:13 -0700 Subject: [PATCH] Fixed: Auto-focusing Filter series import during import series --- frontend/src/Components/Scroller/Scroller.js | 8 +++++++- .../InteractiveImport/Series/SelectSeriesModalContent.js | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/Components/Scroller/Scroller.js b/frontend/src/Components/Scroller/Scroller.js index 4ae94c78b..603e27cc6 100644 --- a/frontend/src/Components/Scroller/Scroller.js +++ b/frontend/src/Components/Scroller/Scroller.js @@ -17,6 +17,8 @@ class Scroller extends Component { componentDidMount() { const { + scrollDirection, + autoFocus, scrollTop } = this.props; @@ -24,7 +26,9 @@ class Scroller extends Component { this._scroller.scrollTop = scrollTop; } - this._scroller.focus({ preventScroll: true }); + if (autoFocus && scrollDirection !== scrollDirections.NONE) { + this._scroller.focus({ preventScroll: true }); + } } // @@ -73,6 +77,7 @@ class Scroller extends Component { Scroller.propTypes = { className: PropTypes.string, scrollDirection: PropTypes.oneOf(scrollDirections.all).isRequired, + autoFocus: PropTypes.bool.isRequired, autoScroll: PropTypes.bool.isRequired, scrollTop: PropTypes.number, children: PropTypes.node, @@ -82,6 +87,7 @@ Scroller.propTypes = { Scroller.defaultProps = { scrollDirection: scrollDirections.VERTICAL, + autoFocus: true, autoScroll: true, registerScroller: () => {} }; diff --git a/frontend/src/InteractiveImport/Series/SelectSeriesModalContent.js b/frontend/src/InteractiveImport/Series/SelectSeriesModalContent.js index 1b4cb52fe..85a1b635a 100644 --- a/frontend/src/InteractiveImport/Series/SelectSeriesModalContent.js +++ b/frontend/src/InteractiveImport/Series/SelectSeriesModalContent.js @@ -62,7 +62,10 @@ class SelectSeriesModalContent extends Component { onChange={this.onFilterChange} /> - + { items.map((item) => { return item.title.toLowerCase().includes(filter) ?