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: The event.value within the onSlideEnd method does not reflect the updated value. #4752

Closed
LeandroMarcondes opened this issue Aug 9, 2023 · 4 comments
Assignees
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Milestone

Comments

@LeandroMarcondes
Copy link
Contributor

Describe the bug

When utilizing the Slider component along with the onSlideEnd event, it's observed that the event.value does not represent the updated value. Instead, it retains the previous value.

Reproducer

https://codesandbox.io/s/primereact-slider-new-value-bug-sv3gwp

PrimeReact version

9.6.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Firefox

Steps to reproduce the behavior

  1. Incorporate the Slider component into your project.
    
  2. Establish two useState hooks, such as (value, newVal).
    
  3. Assign the value prop to {value} and onChange={(e) => setValue(e.value)}.
    
  4. set onSlideEnd={(e) => setNewVal(e.value)}.
    
  5. Display both useState values on the screen.
    
  6. Modify the value of the Slider component.
    

Expected behavior

Once the Slider modifications are completed and the Slider is released or loses focus, the NewVal state should be equal to the value state.

@LeandroMarcondes LeandroMarcondes added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 9, 2023
@akshayaqburst
Copy link
Contributor

I will work on it

@akshayantony55
Copy link
Contributor

I will work on it

Sorry, With the same code in codesandbox and my local environment, its working in my local vs not working in sandbox. Not really sure why!!

image
image

@melloware
Copy link
Member

I think I already fixed this. Check closed tickets

@melloware
Copy link
Member

Duplicate of #4680

@melloware melloware marked this as a duplicate of #4680 Aug 9, 2023
@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2023
@melloware melloware added Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 9, 2023
@melloware melloware self-assigned this Aug 9, 2023
@melloware melloware added this to the 10.0.0 milestone Aug 9, 2023
@melloware melloware modified the milestones: 10.0.0, 9.6.2 Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Projects
None yet
Development

No branches or pull requests

4 participants