File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,19 @@ export class EditablePlugin implements DatagridPlugin {
110110 "input, textarea, select"
111111 )
112112 . forEach ( el => {
113- if ( ! ( el instanceof HTMLSelectElement ) ) {
113+ if ( el instanceof HTMLSelectElement ) {
114+ let submitted = false ;
115+ const submitOnce = ( ) => {
116+ if ( submitted ) return ;
117+ submitted = true ;
118+ submitCell ( el ) ;
119+ } ;
120+ el . addEventListener ( "change" , submitOnce ) ;
121+ el . addEventListener ( "blur" , submitOnce ) ;
122+ } else {
114123 el . addEventListener ( "blur" , ( ) => submitCell ( el ) ) ;
115124 }
116-
125+
117126 el . addEventListener ( "keydown" , e => {
118127 if ( isEnter ( e as KeyboardEvent ) ) {
119128 e . stopPropagation ( ) ;
@@ -129,9 +138,6 @@ export class EditablePlugin implements DatagridPlugin {
129138 }
130139 } ) ;
131140
132- if ( el instanceof HTMLSelectElement ) {
133- el . addEventListener ( "change" , ( ) => submitCell ( el ) ) ;
134- }
135141 } ) ;
136142 }
137143 } ) ;
You can’t perform that action at this time.
0 commit comments