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 component not always provide the originalEvent #384

Closed
keul opened this issue Apr 18, 2018 · 1 comment
Closed

Slider component not always provide the originalEvent #384

keul opened this issue Apr 18, 2018 · 1 comment
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@keul
Copy link
Contributor

keul commented Apr 18, 2018

I'm submitting a ... (check one with "x")

[x] bug report
[x] feature request (mainly is a bug report, but bug has been found trying to get a feature)

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

https://plnkr.co/edit/2E9ZKVxjEAtTsjkDP11O?p=preview

Current behavior
If I provide a step parameter (even if "1") I get no ev.originalEvent.

Expected behavior
I think that originalEvent should be always there

Minimal reproduction of the problem with instructions

I think that issue is in the setValueFromHandle function. event if not passed over when have step:

See:

this.handleStepChange(newValue, this.values[this.handleIndex]);

When I don't have step:

this.updateValue(newValue, event);

Note: My original scope was to use ev.originalEvent.preventDefault() to prevent slide action to work in some situations (the originalEvent is cancelable), but the onChange event is called after the change take place.

I'm wondering if this can be fixed/changed too:

  • calculate the next value
  • call onChange
  • check for originalEvent.defaultPrevented
  • if is false: calling setState to change stored values

Please tell us about your environment:

  • React version:
    16.3.1

  • PrimeReact version:
    1.5.1

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Chrome

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ES 6

mertsincan added a commit that referenced this issue Apr 18, 2018
@mertsincan
Copy link
Member

Note: My original scope was to use ev.originalEvent.preventDefault() to prevent slide action to work in some situations (the originalEvent is cancelable), but the onChange event is called after the change take place.

  • Fixed for next version. Thanks a lot!

@mertsincan mertsincan self-assigned this Apr 18, 2018
@mertsincan mertsincan added this to the 1.6.0 milestone Apr 18, 2018
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Apr 18, 2018
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

No branches or pull requests

2 participants