Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

NumericMenu items ignore the value "0" in their bounds #867

Closed
bgelineau opened this issue Jan 17, 2018 · 2 comments · Fixed by #2882
Closed

NumericMenu items ignore the value "0" in their bounds #867

bgelineau opened this issue Jan 17, 2018 · 2 comments · Fixed by #2882

Comments

@bgelineau
Copy link

Do you want to request a feature or report a bug?

a bug

Bug: What is the current behavior?

MultiRange items ignore the value 0 in their bounds. In the following fiddle, we would expect the "Free" option to return nothing and not every item: https://jsfiddle.net/ar80rgpc/33/ This also impacts ranges with negative values as start:0 will return items with negative values.

Bug: What is the expected behavior?

To handle the 0 value differently than a missing value.

Bug: What browsers are impacted? Which versions?

all

What is the version you are using? Always use the latest one before opening a bug issue.

react-instantsearch@4.4.1

@Haroenv
Copy link
Contributor

Haroenv commented Dec 21, 2018

This is still reproducible with NumericMenu; the replacement of MultiRanges: https://codesandbox.io/s/9oxqnnrkno

@Haroenv Haroenv changed the title MultiRange items ignore the value "0" in their bounds NumericMenu items ignore the value "0" in their bounds Dec 21, 2018
@jhalborg
Copy link

Ran into this bug recently, and would very much appreciate a fix!

(PS: Was encouraged to comment here overhere )

tkrugg added a commit that referenced this issue Dec 17, 2019
This PR adds in connectNumericMenu support for numericRefinement `0`. 
There has been complaints about the following not producing a refinement

```jsx
import { NumericMenu } from 'react-instantsearch-dom';

<NumericMenu
  attribute="price"
  items={[
    { label: '<= 0', start: 0 },
    /* ... */
  ]}
/>
```

fixes #867
Haroenv pushed a commit to algolia/instantsearch that referenced this issue Jan 4, 2023
…instantsearch#2882)


This PR adds in connectNumericMenu support for numericRefinement `0`. 
There has been complaints about the following not producing a refinement

```jsx
import { NumericMenu } from 'react-instantsearch-dom';

<NumericMenu
  attribute="price"
  items={[
    { label: '<= 0', start: 0 },
    /* ... */
  ]}
/>
```

fixes algolia/react-instantsearch#867
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants