File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,23 +34,19 @@ export class NodeEditableDirective implements OnInit {
3434
3535 @HostListener ( 'keyup.enter' , [ '$event.target.value' ] )
3636 private applyNewValue ( newNodeValue : string ) {
37- return this . valueChanged . emit ( { type : 'keyup' , value : newNodeValue } ) ;
37+ this . valueChanged . emit ( { type : 'keyup' , value : newNodeValue } ) ;
3838 }
3939
40- @HostListener ( 'keyup.esc' )
41- private cancelEditing ( ) {
42- return this . valueChanged . emit ( {
43- type : 'keyup' ,
44- value : this . nodeValue ,
45- action : NodeEditableEventAction . Cancel
46- } ) ;
40+ @HostListener ( 'blur' , [ '$event.target.value' ] )
41+ private applyNewValueByLoosingFocus ( newNodeValue : string ) : void {
42+ this . valueChanged . emit ( { type : 'blur' , value : newNodeValue } ) ;
4743 }
4844
49- @HostListener ( 'blur ' )
50- private cancelEditingByLoosingFocus ( ) {
45+ @HostListener ( 'keyup.esc ' )
46+ private cancelEditing ( ) : void {
5147 this . valueChanged . emit ( {
52- type : 'blur' ,
53- value : this . nodeValue ,
48+ type : 'keyup' ,
49+ value : this . nodeValue ,
5450 action : NodeEditableEventAction . Cancel
5551 } ) ;
5652 }
You can’t perform that action at this time.
0 commit comments