File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,12 @@ function next() {
134134 } else {
135135 document . getElementById ( 'back' ) ?. classList . remove ( 'hidden' ) ;
136136 } ;
137+ // focus first input of the new step
138+ const newField = document . querySelector ( `.inputField[step="${ step } "]` ) ;
139+ if ( newField ) {
140+ const input = newField . querySelector ( 'input, textarea, select' ) ;
141+ if ( input ) input . focus ( ) ;
142+ } ;
137143} ;
138144
139145function back ( ) {
@@ -153,6 +159,12 @@ function back() {
153159 document . getElementById ( 'back' ) ?. classList . remove ( 'hidden' ) ;
154160 } ;
155161 document . getElementById ( 'create' ) ?. classList . add ( 'hidden' ) ;
162+ // focus first input of the new step
163+ const newField = document . querySelector ( `.inputField[step="${ step } "]` ) ;
164+ if ( newField ) {
165+ const input = newField . querySelector ( 'input, textarea, select' ) ;
166+ if ( input ) input . focus ( ) ;
167+ } ;
156168} ;
157169
158170function saveChange ( key , value ) {
You can’t perform that action at this time.
0 commit comments