@@ -292,7 +292,7 @@ function fillSQLInputTemplate(sqName, piece) {
292292 state . sqlInputHasTemplate = true ;
293293 // Place cursor on the ??? so the user can immediately type the destination
294294 const idx = input . value . indexOf ( '???' ) ;
295- input . focus ( ) ;
295+ input . focus ( { preventScroll : true } ) ;
296296 input . setSelectionRange ( idx , idx + 3 ) ;
297297 clearSQLRunError ( ) ;
298298}
@@ -876,15 +876,18 @@ function startGame(whiteName, blackName, showSQL, existingPGN) {
876876 clearSQLRunError ( ) ;
877877
878878 // SQL panel visibility
879- const sqlPanel = document . getElementById ( 'sqlPanel' ) ;
880- const lblEl = document . getElementById ( 'sqlToggleLabel' ) ;
881- const iconEl = document . getElementById ( 'sqlToggleIcon' ) ;
879+ const sqlPanel = document . getElementById ( 'sqlPanel' ) ;
880+ const chessPanel = document . getElementById ( 'chessPanel' ) ;
881+ const lblEl = document . getElementById ( 'sqlToggleLabel' ) ;
882+ const iconEl = document . getElementById ( 'sqlToggleIcon' ) ;
882883 if ( state . showSQL ) {
883884 sqlPanel . classList . remove ( 'hidden-panel' ) ;
885+ chessPanel . classList . remove ( 'sql-hidden' ) ;
884886 lblEl . textContent = 'Hide SQL' ;
885887 iconEl . textContent = '◧' ;
886888 } else {
887889 sqlPanel . classList . add ( 'hidden-panel' ) ;
890+ chessPanel . classList . add ( 'sql-hidden' ) ;
888891 lblEl . textContent = 'Show SQL' ;
889892 iconEl . textContent = '□' ;
890893 }
@@ -1003,15 +1006,18 @@ function init() {
10031006 // Toggle SQL Panel
10041007 document . getElementById ( 'btnToggleSQL' ) . addEventListener ( 'click' , ( ) => {
10051008 state . showSQL = ! state . showSQL ;
1006- const sqlPanel = document . getElementById ( 'sqlPanel' ) ;
1007- const lblEl = document . getElementById ( 'sqlToggleLabel' ) ;
1008- const iconEl = document . getElementById ( 'sqlToggleIcon' ) ;
1009+ const sqlPanel = document . getElementById ( 'sqlPanel' ) ;
1010+ const chessPanel = document . getElementById ( 'chessPanel' ) ;
1011+ const lblEl = document . getElementById ( 'sqlToggleLabel' ) ;
1012+ const iconEl = document . getElementById ( 'sqlToggleIcon' ) ;
10091013 if ( state . showSQL ) {
10101014 sqlPanel . classList . remove ( 'hidden-panel' ) ;
1015+ chessPanel . classList . remove ( 'sql-hidden' ) ;
10111016 lblEl . textContent = 'Hide SQL' ;
10121017 iconEl . textContent = '◧' ;
10131018 } else {
10141019 sqlPanel . classList . add ( 'hidden-panel' ) ;
1020+ chessPanel . classList . add ( 'sql-hidden' ) ;
10151021 lblEl . textContent = 'Show SQL' ;
10161022 iconEl . textContent = '□' ;
10171023 }
0 commit comments