File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
umap/static/umap/js/modules Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ export default class TableEditor extends WithTemplate {
214214 const field = `properties.${ property } `
215215 const tr = event . target . closest ( 'tr' )
216216 const feature = this . datalayer . getFeatureById ( tr . dataset . feature )
217- const handler = property === 'description' ? 'Textarea' : 'Input '
217+ const handler = property === 'description' ? 'Textarea' : 'BlurInput '
218218 const builder = new U . FormBuilder ( feature , [ [ field , { handler } ] ] , {
219219 id : `umap-feature-properties_${ L . stamp ( feature ) } ` ,
220220 } )
@@ -226,6 +226,14 @@ export default class TableEditor extends WithTemplate {
226226 cell . innerHTML = feature . properties [ property ] || ''
227227 cell . focus ( )
228228 } )
229+ input . addEventListener ( 'keydown' , ( event ) => {
230+ if ( event . key === 'Escape' ) {
231+ builder . restoreField ( field )
232+ cell . innerHTML = feature . properties [ property ] || ''
233+ cell . focus ( )
234+ event . stopPropagation ( )
235+ }
236+ } )
229237 }
230238
231239 onKeyDown ( event ) {
You can’t perform that action at this time.
0 commit comments