Fixed: Auto-focusing Filter series import during import series

This commit is contained in:
Mark McDowall 2020-05-30 11:04:13 -07:00
parent a32b6276bd
commit 3586d7042b
2 changed files with 11 additions and 2 deletions

View File

@ -17,6 +17,8 @@ class Scroller extends Component {
componentDidMount() { componentDidMount() {
const { const {
scrollDirection,
autoFocus,
scrollTop scrollTop
} = this.props; } = this.props;
@ -24,8 +26,10 @@ class Scroller extends Component {
this._scroller.scrollTop = scrollTop; this._scroller.scrollTop = scrollTop;
} }
if (autoFocus && scrollDirection !== scrollDirections.NONE) {
this._scroller.focus({ preventScroll: true }); this._scroller.focus({ preventScroll: true });
} }
}
// //
// Control // Control
@ -73,6 +77,7 @@ class Scroller extends Component {
Scroller.propTypes = { Scroller.propTypes = {
className: PropTypes.string, className: PropTypes.string,
scrollDirection: PropTypes.oneOf(scrollDirections.all).isRequired, scrollDirection: PropTypes.oneOf(scrollDirections.all).isRequired,
autoFocus: PropTypes.bool.isRequired,
autoScroll: PropTypes.bool.isRequired, autoScroll: PropTypes.bool.isRequired,
scrollTop: PropTypes.number, scrollTop: PropTypes.number,
children: PropTypes.node, children: PropTypes.node,
@ -82,6 +87,7 @@ Scroller.propTypes = {
Scroller.defaultProps = { Scroller.defaultProps = {
scrollDirection: scrollDirections.VERTICAL, scrollDirection: scrollDirections.VERTICAL,
autoFocus: true,
autoScroll: true, autoScroll: true,
registerScroller: () => {} registerScroller: () => {}
}; };

View File

@ -62,7 +62,10 @@ class SelectSeriesModalContent extends Component {
onChange={this.onFilterChange} onChange={this.onFilterChange}
/> />
<Scroller className={styles.scroller}> <Scroller
className={styles.scroller}
autoFocus={false}
>
{ {
items.map((item) => { items.map((item) => {
return item.title.toLowerCase().includes(filter) ? return item.title.toLowerCase().includes(filter) ?