@@ -26,6 +26,7 @@ const Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit
2626 multiline = { ! readonly }
2727 width = { width }
2828 onCommit = { onCommit }
29+ onCancel = { onCancel }
2930 resizable = { true }
3031 />
3132 ) ;
@@ -45,6 +46,7 @@ const Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit
4546 multiline = { true }
4647 width = { width }
4748 onCommit = { encodeCommit }
49+ onCancel = { onCancel }
4850 />
4951 ) ;
5052 } else if ( type === 'Polygon' ) {
@@ -83,6 +85,7 @@ const Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit
8385 multiline = { true }
8486 width = { width }
8587 onCommit = { encodeCommit }
88+ onCancel = { onCancel }
8689 />
8790 ) ;
8891 } else if ( type === 'Date' ) {
@@ -93,17 +96,18 @@ const Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit
9396 readonly = { true }
9497 width = { width }
9598 onCommit = { ( ) => onCommit ( value ) }
99+ onCancel = { onCancel }
96100 />
97101 ) ;
98102 } else {
99- content = < DateTimeEditor value = { value || new Date ( ) } width = { width } onCommit = { onCommit } /> ;
103+ content = < DateTimeEditor value = { value || new Date ( ) } width = { width } onCommit = { onCommit } onCancel = { onCancel } /> ;
100104 }
101105 } else if ( type === 'Boolean' ) {
102106 content = < BooleanEditor value = { value } width = { width } onCommit = { onCommit } /> ;
103107 } else if ( type === 'Number' ) {
104- content = < NumberEditor value = { value } width = { width } onCommit = { onCommit } /> ;
108+ content = < NumberEditor value = { value } width = { width } onCommit = { onCommit } onCancel = { onCancel } /> ;
105109 } else if ( type === 'GeoPoint' ) {
106- content = < GeoPointEditor value = { value } width = { width } onCommit = { onCommit } /> ;
110+ content = < GeoPointEditor value = { value } width = { width } onCommit = { onCommit } onCancel = { onCancel } /> ;
107111 } else if ( type === 'File' ) {
108112 content = < FileEditor value = { value } width = { width } onCommit = { onCommit } onCancel = { onCancel } /> ;
109113 } else if ( type === 'ACL' ) {
@@ -121,7 +125,7 @@ const Editor = ({ top, left, type, targetClass, value, readonly, width, onCommit
121125 ) ;
122126 }
123127 } ;
124- content = < StringEditor value = { value ? value . id : '' } width = { width } onCommit = { encodeCommit } /> ;
128+ content = < StringEditor value = { value ? value . id : '' } width = { width } onCommit = { encodeCommit } onCancel = { onCancel } /> ;
125129 }
126130
127131 return < div style = { { position : 'absolute' , top : top , left : left } } > { content } </ div > ;
0 commit comments