Skip to content

Fix empty search page when search_as_you_type and dirhtml is used#2448

Open
consideRatio wants to merge 1 commit into
pydata:mainfrom
consideRatio:fix/search-as-you-type-dirhtml-search-page
Open

Fix empty search page when search_as_you_type and dirhtml is used#2448
consideRatio wants to merge 1 commit into
pydata:mainfrom
consideRatio:fix/search-as-you-type-dirhtml-search-page

Conversation

@consideRatio

Copy link
Copy Markdown

The setupSearchAsYouType guard checked for a pathname ending in
/search.html, which the dirhtml builder's search/ URL never matches, so
the inline search removed the search page's #search-results container
(searchtools.js's render target) and recreated it empty inside the
search dialog, leaving the page blank. The Escape-key handler reached
resetSearchAsYouTypeResults through a second path with the same effect,
even under the html builder.

Force the search_as_you_type flag off on the dedicated search page from
the html-page-context hook instead, mirroring the pagename == 'search'
guard in layout.html. That disables every inline-search entry point
there through the existing flag guards, for every builder, and the
pathname check becomes dead code.

The setupSearchAsYouType guard checked for a pathname ending in
/search.html, which the dirhtml builder's search/ URL never matches, so
the inline search removed the search page's #search-results container
(searchtools.js's render target) and recreated it empty inside the
search dialog, leaving the page blank. The Escape-key handler reached
resetSearchAsYouTypeResults through a second path with the same effect,
even under the html builder.

Force the search_as_you_type flag off on the dedicated search page from
the html-page-context hook instead, mirroring the pagename == 'search'
guard in layout.html. That disables every inline-search entry point
there through the existing flag guards, for every builder, and the
pathname check becomes dead code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant