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 onChangeEnd event fires before onChange when using arrow keys #6063

Closed
2 tasks done
kgarner7 opened this issue Apr 11, 2024 · 3 comments · Fixed by #6064
Closed
2 tasks done

Slider onChangeEnd event fires before onChange when using arrow keys #6063

kgarner7 opened this issue Apr 11, 2024 · 3 comments · Fixed by #6064
Labels
Works as intended The behavior described in the issue is intended and is not a bug

Comments

@kgarner7
Copy link
Contributor

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.7.2

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

All

Describe the bug

When using a Slider component with onChange and onChangeEnd events, using arrow keys to change the value will cause the onChangeEnd event to fire before onChange

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

Reorder the events at

onChangeEnd?.(nextValue);
setValue(nextValue);

Self-service

  • I would be willing to implement a fix for this issue
@rtivital
Copy link
Member

onChnageEnd is called whenever the user stops any interactions with the component. onChange is called when value changes. The logic is correct, the order of functions calls does not matter.

@rtivital rtivital added the Works as intended The behavior described in the issue is intended and is not a bug label Apr 11, 2024
@kgarner7
Copy link
Contributor Author

I disagree. The order matters if you are relying on onChangeEnd to denote that seeking has finished. This caused a real bug jeffvli/feishin#581

@rtivital
Copy link
Member

Okay, I do not mind to merge the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Works as intended The behavior described in the issue is intended and is not a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants