File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
ep17-edit-todo/app/components Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ export default class DisplayItem extends React.Component {
7
7
this . state = { editing : false }
8
8
}
9
9
10
+ handleEditing ( event ) {
11
+ this . setState ( { editing : true } ) ;
12
+ }
13
+
14
+ handleEditingDone ( event ) {
15
+ }
16
+
10
17
render ( ) {
11
18
var todo = this . props . todo ;
12
19
@@ -20,7 +27,7 @@ export default class DisplayItem extends React.Component {
20
27
}
21
28
22
29
return < li className = { todo . done ? 'done' : '' } >
23
- < div style = { viewStyle } >
30
+ < div style = { viewStyle } onDoubleClick = { this . handleEditing . bind ( this ) } >
24
31
< input
25
32
checked = { todo . done }
26
33
onChange = { this . props . handleDone . bind ( null , todo . id ) }
@@ -39,6 +46,7 @@ export default class DisplayItem extends React.Component {
39
46
</ div >
40
47
41
48
< input type = "text"
49
+ onKeyDown = { this . handleEditingDone . bind ( this ) }
42
50
style = { editStyle }
43
51
value = { todo . title } />
44
52
</ li >
You can’t perform that action at this time.
0 commit comments