Skip to content
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

Holding backspace does not remove first character in refinementList search field #28

Open
polkabrothers opened this issue Jan 13, 2021 · 9 comments
Labels

Comments

@polkabrothers
Copy link

Description

When using a searchable refinementList and using search inside the facet widget to filter results, the first character is not cleared if holding backspace, removing characters one at a time works though.

Example from: https://recipe-search.typesense.org/
ts_facet

Steps to reproduce

Go to https://recipe-search.typesense.org/
Search for something
Type something in the filter ingredients facet search
Hold backspace to remove facet search string completely

@jasonbosco jasonbosco added the bug Something isn't working label Jan 19, 2021
@jasonbosco
Copy link
Member

@polkabrothers Did you notice this issue in your app, or did you only see it on the recipe search site? If it's the latter, it's actually a side-effect of how I've implemented the search on that site. It's on my todo list to fix, but it's not directly related to this adapter.

@jasonbosco jasonbosco added triage and removed bug Something isn't working labels Jan 25, 2021
@unclescooby
Copy link

Possibly related: doing this in the main search input will not remove the first character in the url query string

@polkabrothers
Copy link
Author

@jasonbosco This happens in my app as well.

@diegodeluca
Copy link

There are any news about this issue?

@jasonbosco
Copy link
Member

I took a look at this, but I don't think is related to the typesense instantsearch adapter. This seems like an issue in instantsearch itself. For eg, if you press backspace and delete one character at a time then this issue doesn't happen. So this suggests to me that there is some race condition in the event handler inside instantsearch where it fires off multiple parallel calls and then uses whatever call returns last (even if its out of order) to render the UI state, when instead it should probably serialize the requests, or cancel a request that's in-flight before initiating a new search request from this widget.

@diegodeluca
Copy link

I've tried with any example at this page: https://typesense.org/docs/overview/demos.html and even deleting one letter at time or using only one letter the issue persists.

The issue isn't present on the example in typesense homepage https://typesense.org/

@jasonbosco
Copy link
Member

Hmm, here's a screengrab showing the issue happening initially when I hold down the backspace key, and then not happening when I delete one character at a time:

Screen.Recording.2022-02-04.at.3.23.10.PM.mov

Or at least this is what I understood of the issue. Is this the same issue you're experiencing as well?

@diegodeluca
Copy link

I was referring about the main search box, where you searched "pizza"

@jasonbosco
Copy link
Member

jasonbosco commented Feb 4, 2022

Hmm, that's potentially a different issue then. Could you open a separate Github issue describing the exact issue you're seeing?

This issue was originally only related to searching within the search box in the refinementList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants