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 is only working on new page loads #978

Commits on May 1, 2021

  1. Replace hardcoded key with variable (this is safe to "leak" but I fel…

    …d bad hardcoding it inside a component) and add useEffect to re-apply search in first render. The current plugin uses a mutation observer that is loaded with a DOMContentLoaded event that does not fire on the pure JS page transitions in Gatsby. So when you navigate to another page, the plugin does not try to find the search input box.
    javiergamarra committed May 1, 2021
    Configuration menu
    Copy the full SHA
    98bdf73 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b8f2640 View commit details
    Browse the repository at this point in the history
  3. This is causing a JS warning because attributes are usually lowercase…

    … and… I do not understand why/how is this being used. I guess it’s a C&P error from setting the prop in the component just before.
    javiergamarra committed May 1, 2021
    Configuration menu
    Copy the full SHA
    ceece08 View commit details
    Browse the repository at this point in the history
  4. You have duplicated orders. This is fine for Gatsby (I think, 0 exper…

    …ience with Gatsby) but you are using order as the key to an iteration in React and this is not fine for React and causes all sort of problems. See https://reactjs.org/docs/lists-and-keys.html#keys.
    javiergamarra committed May 1, 2021
    Configuration menu
    Copy the full SHA
    01a4ea2 View commit details
    Browse the repository at this point in the history
  5. This is cumbersome but at least allows using the repository without s…

    …etting any key. Newsletters won’t work of course.
    javiergamarra committed May 1, 2021
    Configuration menu
    Copy the full SHA
    abc910f View commit details
    Browse the repository at this point in the history