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

NumericMenu does not properly support zero values for single direction options #6156

Open
1 task done
justindantzer opened this issue Apr 23, 2024 · 0 comments
Open
1 task done
Labels
triage Issues to be categorized by the team

Comments

@justindantzer
Copy link

πŸ› Current behavior

From what I can tell, when NumericMenu options have only one range option and either start or end with 0, the URL routing value is ignored. However, when both start and end are 0 β€” equating to = 0 β€” the URL will get updated correctly. Positive and negative non-zero numbers work as expected.

Example failing option:
{ label: '<= 0', end: 0}

πŸ” Steps to reproduce

  1. Select rating option of a non-zero >/<= value
  2. Updated URL contains rating filter selection
  3. Select rating >/<= 0
  4. Updated URL does not contain rating filter selection

Live reproduction

https://codesandbox.io/p/sandbox/instantsearch-numeric-menu-zero-test-vx32wy

πŸ’­ Expected behavior

The URL should get updated with the zero-based value, like 0: or :0, depending on the option selection and configuration.

Example URL query string:
?instant_search[numericMenu][rating]=:0

Package version

algoliasearch 4.23.3, instantsearch 4.67.0

Operating system

No response

Browser

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@justindantzer justindantzer added the triage Issues to be categorized by the team label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

1 participant