File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,17 @@ function initializeLocalTheme() {
1818 } ) ;
1919}
2020
21- function initializeCustomSelect ( ) {
21+ function initializeCustomSelect ( initialValue = null ) {
2222 const button = document . getElementById ( 'language-button' ) ;
2323 const select = document . getElementById ( 'language-select' ) ;
2424 if ( ! button || ! select ) return ;
2525
2626 const dropdown = button . nextElementSibling ;
2727 const selectedValue = button . querySelector ( '.selected-value' ) ;
2828
29+ if ( initialValue ) {
30+ select . value = initialValue ;
31+ }
2932 selectedValue . textContent = select . options [ select . selectedIndex ] . text ;
3033
3134 button . addEventListener ( 'click' , ( e ) => {
@@ -565,6 +568,7 @@ window.initializePlayground = async function initializePlayground(opts) {
565568 queryInput . value = query ;
566569 codeInput . value = sourceCode ;
567570 languageSelect . value = language ;
571+ initializeCustomSelect ( language ) ;
568572 anonymousNodes . checked = anonNodes === "true" ;
569573 queryCheckbox . checked = queryEnabled === "true" ;
570574 }
You can’t perform that action at this time.
0 commit comments