File tree Expand file tree Collapse file tree
admin/app/components/solidus_admin/option_types/edit/option_values_table/row Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,4 +10,12 @@ export default class extends Controller {
1010 remove ( ) {
1111 this . element . remove ( ) ;
1212 }
13+
14+ applyOnEnter ( event ) {
15+ const submitter = event . target . form . elements . apply
16+ if ( submitter ) {
17+ event . preventDefault ( ) ;
18+ event . target . form . requestSubmit ( submitter ) ;
19+ }
20+ }
1321}
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ def columns
4545 "aria-label" : true ,
4646 form : @form_id ,
4747 "data-#{ stimulus_id } -target" : "focusable" ,
48+ "data-action" : "keydown.enter->#{ stimulus_id } #applyOnEnter" ,
4849 )
4950 end
5051 } ,
@@ -57,6 +58,7 @@ def columns
5758 class : "required" ,
5859 "aria-label" : true ,
5960 form : @form_id ,
61+ "data-action" : "keydown.enter->#{ stimulus_id } #applyOnEnter" ,
6062 )
6163 end
6264 }
You can’t perform that action at this time.
0 commit comments