File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -599,7 +599,22 @@ jtd.onReady(function() {
599599 const searchInput = document . getElementById ( "search-input" ) ;
600600 const input = query ;
601601
602- if ( ! query || ! resultsContainer ) return ;
602+ if ( ! resultsContainer ) return ;
603+
604+ // Handle empty search query
605+ if ( ! query ) {
606+ // Check if there was a q parameter but it was empty
607+ if ( urlParams . has ( "q" ) ) {
608+ let pageTitle = document . querySelector ( 'title' ) ;
609+ let h1 = document . querySelector ( 'h1' ) ;
610+
611+ if ( pageTitle ) pageTitle . innerText = 'Empty Search Query - No Results' ;
612+ if ( h1 ) h1 . innerText = 'No Search Term Entered' ;
613+
614+ resultsContainer . innerHTML = '<p>Please enter a search term to find relevant content.</p>' ;
615+ }
616+ return ;
617+ }
603618
604619 if ( searchInput ) searchInput . value = query ;
605620
You can’t perform that action at this time.
0 commit comments