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

Slider with range and max=10 - initial right slider position is 1000 #3738

Closed
MelodyAnn84 opened this issue Dec 2, 2022 · 1 comment · Fixed by #3739
Closed

Slider with range and max=10 - initial right slider position is 1000 #3738

MelodyAnn84 opened this issue Dec 2, 2022 · 1 comment · Fixed by #3739
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@MelodyAnn84
Copy link

Describe the bug

Try to set max={10} in the code here -

<Slider value={options.value} onChange={(e) => options.filterCallback(e.value)} range className="m-3"></Slider>

see that the initial state of the right slider is way out of boundaries ( set to 100*10 in this case ).

  • the slider itself behaves like it's still 0-100 one, until you touch the right slider => then it works as expected.

image

Reproducer

https://codesandbox.io/s/3rso2u?file=/src/demo/DataTableFilterDemo.tsx

PrimeReact version

8.7.2

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. set max={10} in the Slider of Activity column filter
  2. click this filter button
  3. see that the right slider position (and the slider width) is initiated with x100 bigger value than it's specified in the "max" field.

Expected behavior

Slider to behave exactly like it does with the default value, just within 0-10 range.

@MelodyAnn84 MelodyAnn84 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 2, 2022
melloware added a commit to melloware/primereact that referenced this issue Dec 3, 2022
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 3, 2022
@melloware melloware self-assigned this Dec 3, 2022
@melloware melloware added this to the 8.7.3 milestone Dec 3, 2022
@melloware
Copy link
Member

Thanks for the reproducer. Definitely a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants