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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider onChangeEnd doesn't get triggered when clicking and triggered twice when dragging #3860

Closed
j-dominguezp opened this issue Apr 20, 2021 · 8 comments
Labels
Type: Bug 馃悰 Something isn't working

Comments

@j-dominguezp
Copy link

j-dominguezp commented Apr 20, 2021

馃悰 Bug report

Slider onChangeEnd event doesn't get triggered when clicking in the slider track.
Also, when dragging event gets triggered twice (at start and at the end).

馃挜 Steps to reproduce

  1. Add console.log to onChangeEnd event.
  2. Click anywhere in the slider tack without touching the Slider Thumb.
  3. Check logs, you'll see onChangeEnd doesn't get trigerred.
  4. Drag the Slider Thumb from any position to any position.
  5. Check logs, you'll see onChangeEnd gets triggered twice.

馃捇 Link to reproduction

CodeSandbox reproduction: https://codesandbox.io/s/nervous-almeida-pzbmm?file=/pages/index.tsx

slider issue

馃 Expected behavior

  1. onChangeEnd event should get triggered when clicking any position of the slider track.
  2. When dragging onChangeEnd event should get triggered only at the end of the dragging.

馃實 System information

Software Version(s)
Chakra UI 1.6.0
Browser Edge Dev 91.0.852.0
Operating System Windows 10

馃摑 Additional information

Also tested this in Firefox and Chrome, is happening too.

Any way I can provide more information let me know. :)

@j-dominguezp
Copy link
Author

Reopened this one as I reproduced it again.

Thought it was working, but it was a weird error in the sandbox not using the latest version of chakra.

@ProxyJoshua
Copy link

I'm having the same problem, don't know why is happening

@j-dominguezp
Copy link
Author

j-dominguezp commented Apr 24, 2021

I'm having the same problem, don't know why is happening

Yes, still happening.

Sadly, I haven't found a workaround for this.

This is my use case:

I have a form where I need to go into the next step of the form right after the onChangeEnd event fires.

But as the event is triggered at the start and end, users can't event drag the slider when they are moved into the next step.

And when clicking, event doesn't trigger, so it's kind of weird :(

@nollidnosnhoj
Copy link

I am getting the same issue as well: https://codesandbox.io/s/confident-jackson-zlg17?file=/src/App.tsx but I'm using Chakra 1.6.0

@segunadebayo
Copy link
Member

I just pushed a fix for this. We'll release an update shortly.

If the issue persists after upgrading, I'll re-open it.

@segunadebayo segunadebayo added the Type: Bug 馃悰 Something isn't working label Apr 29, 2021
@pedrozaalex
Copy link

I'm sorry to say it, but I believe that the problem persists: https://codesandbox.io/s/aged-browser-4df3l?file=/src/App.js

@nollidnosnhoj
Copy link

nollidnosnhoj commented Aug 12, 2021

This seems to be a regression bug. It works on 1.6.5 (doesnt on 1.6.6) https://codesandbox.io/s/damp-sea-7oc2x

@segunadebayo Possible that this fix may caused the onChangeEnd to not trigger when clicking on a slider track. This is not an issue in 1.6.5 (view codesandbox link)

@aagwali
Copy link

aagwali commented Aug 13, 2021

Hello,
Same behavior for me in 1.6.6

Using 1.6.5 it works, except when going from a boundary to 50% :

from any %, click on 50% => onChangeEnd is triggered correctly
100% click on 50% => no Event triggered
0% click on 50% => no Event triggered

Not sure if its related to 1.6.6 bug

NB : 50% is the original default value in the test.

Edit : some other starting values seems to also be buggy but destination is always 50%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 馃悰 Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants