-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Show autocomplete results when you change the search type #10359
Comments
Hi @RayBB Ah, great finding! I was actually experiencing this issue before, and it would be awesome to see it resolved. Is it possible for me to get assigned to this issue? I'd love to work on it. Looking forward to your response! |
@SharkyBytes yes go for it 👍 |
Moving forward, as a matter of team policy, I'd like if staff have a chance to review and triage issues prior to assignment (re: project management notes). Sorry for the cases where this may cause a bit of lag time. Also, apologies as I know not all our docs are easily discoverable yet! @SharkyBytes I'm also noticing you're currently assigned to 4 issues now that have no PR's associated so if possible i'd love us to followup or drop some of those issues before pushing forward with another! Thank you both :) |
@mekarpeles is this issue considered triaged? |
@RayBB I think I have figured this out. Turns out, the current change handler for the autocomplete was triggered if the search bar was in focus. I changed the code to trigger the autocomplete whenever the facet is changed. Here is the current code: openlibrary/openlibrary/plugins/openlibrary/js/SearchBar.js Lines 361 to 371 in 11838fa
And I changed it to this: handleFacetValueChange(newFacet) {
// update the UI
this.$facetSelect.val(newFacet);
const text = this.$facetSelect.find('option:selected').text();
$('header#header-bar .search-facet-value').html(text);
// Add immediate refresh when input has value
if (this.$input.val()) {
this.renderAutocompletionResults();
}
} Here's the demo: autocomplete-demo.webmThanks! |
I'm still waiting for @mekarpeles to confirm if this this triaged or not. Your solution seems like a good start to me though. Is it change any other behavior like when you click on another part of the page or move focus away with tab? We'll want that functionality to remain the same. |
@RayBB yes that thing is intact. I've simple changed the handler that handles a change in the facet, nothing else. |
Problem
Right now if you change the search type at the top of OL from something like "title" to "author" we don't show the results right away, you have to click the text box before the results show. It would be great if we showed the results right away.
See video (with audio) for example.
search.mp4
Reproducing the bug
Context
Breakdown
Requirements Checklist
Related files
Stakeholders
Instructions for Contributors
The text was updated successfully, but these errors were encountered: