File tree Expand file tree Collapse file tree
src/inner_templates/workouteditor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 919919 const field = FIELD_DEFS . find ( f => f . key === key ) ;
920920 if ( field && field . syncWith ) {
921921 state . intervals [ index ] [ field . syncWith ] = speed ;
922+ // Update speed field directly without re-render to keep focus
923+ const speedInput = document . querySelector ( `input[data-index="${ index } "][data-key="${ field . syncWith } "]` ) ;
924+ if ( speedInput ) {
925+ speedInput . value = speed ;
926+ }
922927 }
923928 }
924- // Re-render to update both fields
925- renderIntervals ( ) ;
926929 updateChart ( ) ;
927930 updateStatus ( ) ;
928931 return ;
929932 } else if ( type === 'number' ) {
930933 const raw = target . value ;
931934 state . intervals [ index ] [ key ] = raw === '' ? undefined : Number ( raw ) ;
932- // If this is a speed field, re-render to update pace
935+ // If this is a speed field, update pace field directly without re-render to keep focus/keyboard open
933936 if ( key === 'speed' ) {
934- renderIntervals ( ) ;
937+ const paceInput = document . querySelector ( `input[data-index="${ index } "][data-key="pace"]` ) ;
938+ if ( paceInput ) {
939+ const speedValue = state . intervals [ index ] [ key ] ;
940+ paceInput . value = speedValue ? speedToPace ( speedValue ) : '' ;
941+ }
935942 }
936943 } else {
937944 const raw = target . value ;
You can’t perform that action at this time.
0 commit comments