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

Facets are missing if the search contains leading spaces #19986

Open
lunaticdesignz opened this issue Feb 12, 2025 · 0 comments
Open

Facets are missing if the search contains leading spaces #19986

lunaticdesignz opened this issue Feb 12, 2025 · 0 comments

Comments

@lunaticdesignz
Copy link

Describe the bug
If the user enters a space before the search term in the searchbox and submits that search, no facets will appear next to the products on the search results page. The problem happens e.g. when a user copies the search term from a document and pastes it into the searchbox.

The reason for this is that the logic in the filterForPage method in the ProductFacetService checks whether the search term matches the freeTextSearch propety from the response from the backend. However, the inputs are trimmed in the backend and not in the frontend. This will filter out the searchResult$ for the facets as not relevant.

Tell us the version of Spartacus

  • Library version: 2211.28

To Reproduce
Steps to reproduce the behavior:

  1. Go to home page
  2. Enter a space followed by any serch term
  3. Submit that search
  4. See that there are no facets displayed

Expected behavior
All products and facets should be displayed even with copied spaces before or after the search term. I would expect that the logic that trims the search term corresponds to that in the backend for consistent behavior.

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

No branches or pull requests

1 participant