Skip to content

Commit 449c7e2

Browse files
committed
only focus on mount and when new props are received (a default filename)
1 parent 2c54849 commit 449c7e2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/views/save-overlay.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,11 @@ class SaveOverlay extends React.Component {
3939
this.focusInput();
4040
}
4141

42-
componentDidUpdate() {
43-
this.focusInput();
44-
}
45-
4642
componentWillReceiveProps(nextProps){
4743
const { typing } = this.state;
4844

4945
if(!typing){
46+
this.focusInput();
5047
this.setState({ filename: nextProps.defaultFilename });
5148
}
5249
}
@@ -55,8 +52,7 @@ class SaveOverlay extends React.Component {
5552
const { filename } = this.state;
5653

5754
const {
58-
saveFileAs,
59-
hideOverlay
55+
saveFileAs
6056
} = this.props.handlers;
6157

6258
saveFileAs(filename);

0 commit comments

Comments
 (0)