-
Notifications
You must be signed in to change notification settings - Fork 887
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
Algolia - Mobile navigation/search #1433
Comments
Aha, so what I think is happening here is what I discovered in #1250 when trying to add Algolia to the left nav search. If you also have the default top bar search, Algolia will only work in the first div it encounters, which will be the top bar search - hence it's working fine for you on desktop. Here's what I found:
Our current code just duplicates the div in both locations (regardless of search method). I can probably revisit this and see if we can do something without actually going mad with conditionals. |
Thank you for the explanation @LisaFC Any particular timeline for this issue? We are using the autocomplete version of Algolia which uses the pop-out modal and takes on a full-screen approach on responsive layouts. I can look into a potential temporary fix for mobile, but I'm not sure how I'd approach expanding that into tablet. |
Slightly hacky solution demoed here: Source: https://github.com/LisaFC/test-search The main oddness is that I needed to put the footer script in twice (once for each div) but it does work! Also I could do something nicer in the layout with the special mobile version of the search prompt (you'll see it if you make the page mobile width). |
Let me know if this works for you and I can do a proper/nicer PR. @jmichelgarcia I know you had similar issues. |
IIRC, I did a hack:
|
Gotcha. So what I did is a bit more generalized in that it should work without having to change any of the current behaviour. There doesn't seem to be any way around having to put the script in twice (it clearly states in their docs that even if the selector matches multiple containers, it will only pick the first one), but maybe that's not too onerous... |
Hey everyone,
I've read the documentation regarding Algolia not supporting the sidebar, however our team recently re-enabled Algolia on our doc site for testing and we do not see the search box appearing in the mobile navigation dropdown. When I inspect the mobile navigation, I see the element
<div id="docsearch"></div>
but none of the content is displaying from it and the div doesn't actually appear. It's as if the Javascript from Algolia isn't being injected properly on mobile.Is there any additional configuration settings or modifications that need to be made to the search-input partial to enable this? I see the search box on desktop just fine.
The text was updated successfully, but these errors were encountered: