Code Monkey home page Code Monkey logo

Comments (3)

JVankat avatar JVankat commented on August 14, 2024

To me this looks like an integration issue rather than an issue with the component.

You're not using the search inputs rendered by this plugin, is that correct?

The issue seems to be the following:

  1. the search inputs don't get recreated on navigation
  2. the SiteSearch360 component gets recreated after you navigate to another page --> the componentDidMount hook is called and it rebinds all event listeners on the inputs
  3. nevertheless, the events have already been bound, so duplicate events get created on the search inputs which results in this behavior

So, the solution should be either making sure the SiteSearch360 component only mounts when the search inputs are recreated (probably integrating our component directly in the header), or integrating the search script manually.

from site-search-360-react.

don-esteban avatar don-esteban commented on August 14, 2024

Thanks for your quick response.

To me this looks like an integration issue rather than an issue with the component.

Correct.

If someone cares. The search component was part of both. The top-line (large screens) and the hamburger menu (small screens). Depending on screen size, CSS hided the one or the other. Removing the search component from hamburger menu resolved the issue.

Bonus question: is it possible to pace the search component two times on one page? We plan a new header navigation, still using two search components and CSS/media queries to show/hide the components accordingly.

from site-search-360-react.

JVankat avatar JVankat commented on August 14, 2024

Yes, that should be possible, we're using the vue app in our control panel multiple times on a page (with different configurations), and the vue app is basically the same as the react app.

So, as long as you make sure the events aren't bound multiple times, everything should work as expected.

from site-search-360-react.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.