-
Notifications
You must be signed in to change notification settings - Fork 395
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
Ctrl-click on results #517
Conversation
…hting in lvl1 & lvl0
Deploy preview ready Built with commit fe530ca |
Live demo of the new search https://docsearch-pr517.surge.sh/ |
src/lib/DocSearch.js
Outdated
@@ -64,7 +64,7 @@ class DocSearch { | |||
this.apiKey = apiKey; | |||
this.appId = appId; | |||
this.indexName = indexName; | |||
this.input = DocSearch.getInputFromSelector(inputSelector); | |||
this.input = DocSearch.getInputsFromSelector(inputSelector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can now accept several selectors and not just one, I would rename this.input
to this.inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I will enhance it with the string selectors
src/lib/templates.js
Outdated
@@ -67,7 +71,9 @@ const templates = { | |||
`, | |||
footer: ` | |||
<div class="${footerPrefix}"> | |||
Search by <a class="${footerPrefix}--logo" href="https://www.algolia.com/docsearch">Algolia</a> | |||
<a class="${footerPrefix}--logo" aria-label="Search by algolia" href="https://www.algolia.com/docsearch"> | |||
<img src="${searchByAddress}" alt="Search by algolia" height="100%" width="100%"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be using an external url for the image. I would rather have it either as an inline SVG in the JavaScript, or as a background image from the CSS. In any case, if we use an URL, we should use one that targets an origin we control (ie. something in the DocSearch repo, or DocSearch website, not on the main Algolia website).
I'm gonna ping @JonasBa on this: How do you suggest we include the "Powered by Algolia" logo in DocSearch? As an inline SVG, a background image or a hotlink?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will use https://instantsearch-css.netlify.com/widgets/powered-by/ instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh neat.
Co-Authored-By: s-pace <[email protected]>
Co-Authored-By: s-pace <[email protected]>
I removed the multi-input feature as it was not working as intended (we only return one instance, so we cannot bind it to two different inputs). I also remove the two inputs from the playground (keeping only one), as we don't yet handle multiple inputs, it was confusing. I changed the handleSelected logic so it works with links. Basically by default a This works well from my manual tests, I still have one unit test to write and it should be ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need test and we go live 🎉
@pixelastic I wanted to resolve automatically the conflicts. I have used the hint provided by github. It actually merges everything. |
I think we do not have any issue with releasing it straight away. I do not see any breaking change. Use os really regular so let's release the v2 :) |
Could you have a look regarding gzip or any way to reduce the size of it pls? |
We're still missing at least one test. I would not release something that hasn't been tested
Yes, and I think the logo display is bigger in that branch than it used to be. I'd like to double check that before the release as well. |
Fine with it. Write a test and then we can release 🎉 |
PR that:
Enable multi input