Skip to content

Commit d179d6c

Browse files
committed
Resolve linting errors
1 parent 0880f8d commit d179d6c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/react-select/src/Select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
import React, { Component, type ElementRef, type Node, type Ref } from 'react';
3+
import React, { Component, type ElementRef, type Node } from 'react';
44
import memoizeOne from 'memoize-one';
55
import { MenuPlacer } from './components/Menu';
66
import isEqual from './internal/react-fast-compare';

packages/react-select/src/internal/ScrollManager.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type State = {
2222

2323
const defaultProps = {
2424
captureEnabled: true
25-
}
25+
};
2626

2727
export default class ScrollManager extends PureComponent<Props,State> {
2828
static defaultProps = defaultProps;
@@ -40,12 +40,18 @@ export default class ScrollManager extends PureComponent<Props,State> {
4040
blurSelectInput = () => document.activeElement && document.activeElement.blur();
4141

4242
componentDidMount() {
43-
this.props.captureEnabled && this.startListening(this.targetRef.current);
43+
if (this.props.captureEnabled) {
44+
this.startListening(this.targetRef.current);
45+
}
4446
}
4547

4648
componentDidUpdate(prevProps: Props) {
4749
if (prevProps.captureEnabled !== this.props.captureEnabled) {
48-
this.props.captureEnabled ? this.startListening(this.targetRef.current) : this.stopListening(this.targetRef.current);
50+
if (this.props.captureEnabled) {
51+
this.startListening(this.targetRef.current);
52+
} else {
53+
this.stopListening(this.targetRef.current);
54+
}
4955
}
5056
}
5157

0 commit comments

Comments
 (0)