Comments (3)
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:
- the search inputs don't get recreated on navigation
- 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
- 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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from site-search-360-react.