Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search bar results link and SearchPage don't load new results after first view #30

Open
dtlhlbs opened this issue Mar 2, 2023 · 3 comments

Comments

@dtlhlbs
Copy link

dtlhlbs commented Mar 2, 2023

Description

When I use the search box for a second time it fails to reload the search.

Steps to reproduce

  1. Go to home
  2. Search for content using search bar
  3. Scroll to bottom results link
  4. Select results link and view all results
  5. Use the search bar for another term
  6. Scroll to bottom results link
  7. Select results link and view
  8. Repeat 5-7

Expected Behavior

New results will show for the new search terms

Actual Behavior

Old results from first search term continue to show

Metadata

Typesense Version: 0.9.0 (docusaurus-theme-search-typesense)

OS:
Windows Chrome 109.0.5414.120 (Official Build) (64-bit)
search-bug.webm

@jasonbosco
Copy link
Member

@dtlhlbs I was able to replicate this issue in the Algolia search plugin that comes built-in with Docusaurus.

Since docusaurus-theme-search-typesense is a fork of the built-in Algolia plug-in, I think it would be more efficient to fix the issue in the built-in plugin and I can then pull those fixes into this fork.

Could you open an issue in the main docusaurus repo about this issue? (I was able to easily replicate this on docusaurus.com's search bar, which uses the Algolia plugin).

@dtlhlbs
Copy link
Author

dtlhlbs commented Mar 9, 2023

facebook/docusaurus#8755

@slorber
Copy link

slorber commented Mar 10, 2023

@jasonbosco FYI I totally removed the useSearchPage hook in facebook/docusaurus#8757, in favor of 2 more specific hooks.

I made the 2 apis public in case you want to use them to simplify your plugin code. It's basically the same as the older useSearchPage but instead split in 2 distinct hooks with a more focused use-case.

import {useSearchLinkCreator,useSearchQueryString} from '@docusaurus/theme-common';

Will be backported for v2.4 unless you think it can be a problem for such third-party plugins (ping me in the PR in this case, I may miss replies here)

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

No branches or pull requests

3 participants