We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3d0476a + ebdd6db commit 1da1e9dCopy full SHA for 1da1e9d
examples/todomvc/components/TodoTextInput.js
@@ -31,6 +31,12 @@ export default class TodoTextInput extends Component {
31
this.setState({ text: e.target.value });
32
}
33
34
+ handleBlur(e) {
35
+ if (!this.props.newTodo) {
36
+ this.props.onSave(e.target.value);
37
+ }
38
39
+
40
render() {
41
return (
42
<input className={classnames({
@@ -41,7 +47,7 @@ export default class TodoTextInput extends Component {
47
placeholder={this.props.placeholder}
48
autoFocus='true'
43
49
value={this.state.text}
44
- onBlur={(e) => this.props.onSave(e.target.value)}
50
+ onBlur={::this.handleBlur}
45
51
onChange={::this.handleChange}
46
52
onKeyDown={::this.handleSubmit} />
53
);
0 commit comments