Skip to content

Commit e63ce2d

Browse files
fix: restore search by keeping hidden search-button element in DOM
The just-the-docs.js initNav() calls jtd.addEvent on the #search-button element unconditionally. When the element was removed (to avoid overlap with the OSA chat widget), jtd.addEvent(null, ...) threw an error, preventing initSearch() from ever executing. The search index was never built, leaving the header search input non-functional. Restore the button with display:none so the JS doesn't crash while keeping it invisible to avoid overlap with the chat widget.
1 parent b176eda commit e63ce2d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

_layouts/default.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ <h2 class="text-delta">Table of contents</h2>
189189
</div>
190190

191191
{% if site.search_enabled != false %}
192+
{% if site.search.button %}
193+
<a href="#" id="search-button" class="search-button" style="display:none;">
194+
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-search"></use></svg>
195+
</a>
196+
{% endif %}
197+
192198
<div class="search-overlay"></div>
193199
{% endif %}
194200
</div>

0 commit comments

Comments
 (0)