Fixed: Manual Import Movie filter Input losing focus

Fixes #4297

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
pull/4463/head
Qstick 4 years ago
parent 8112ca5a43
commit 5de1f4563a

@ -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: () => {}
}; };

@ -95,6 +95,7 @@ class VirtualTable extends Component {
className, className,
items, items,
scroller, scroller,
focusScroller,
header, header,
headerHeight, headerHeight,
rowRenderer, rowRenderer,
@ -135,6 +136,7 @@ class VirtualTable extends Component {
<Scroller <Scroller
className={className} className={className}
scrollDirection={scrollDirections.HORIZONTAL} scrollDirection={scrollDirections.HORIZONTAL}
autoFocus={focusScroller}
> >
{header} {header}
<div ref={registerChild}> <div ref={registerChild}>
@ -179,6 +181,7 @@ VirtualTable.propTypes = {
items: PropTypes.arrayOf(PropTypes.object).isRequired, items: PropTypes.arrayOf(PropTypes.object).isRequired,
scrollIndex: PropTypes.number, scrollIndex: PropTypes.number,
scroller: PropTypes.instanceOf(Element).isRequired, scroller: PropTypes.instanceOf(Element).isRequired,
focusScroller: PropTypes.bool.isRequired,
header: PropTypes.node.isRequired, header: PropTypes.node.isRequired,
headerHeight: PropTypes.number.isRequired, headerHeight: PropTypes.number.isRequired,
rowRenderer: PropTypes.func.isRequired rowRenderer: PropTypes.func.isRequired
@ -186,7 +189,8 @@ VirtualTable.propTypes = {
VirtualTable.defaultProps = { VirtualTable.defaultProps = {
className: styles.tableContainer, className: styles.tableContainer,
headerHeight: 38 headerHeight: 38,
focusScroller: true
}; };
export default VirtualTable; export default VirtualTable;

@ -147,6 +147,7 @@ class SelectMovieModalContent extends Component {
<Scroller <Scroller
registerScroller={this.setScrollerRef} registerScroller={this.setScrollerRef}
className={styles.scroller} className={styles.scroller}
autoFocus={false}
> >
<div> <div>
{ {
@ -159,6 +160,7 @@ class SelectMovieModalContent extends Component {
items={suggestions} items={suggestions}
isSmallScreen={false} isSmallScreen={false}
scroller={scroller} scroller={scroller}
focusScroller={false}
rowRenderer={this.rowRenderer} rowRenderer={this.rowRenderer}
/> />
} }

Loading…
Cancel
Save