-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Unselecting the last element doesn't trigger move
and stop
#238
Comments
move
and stop
events also doesn't update internal statemove
and stop
Hey @carlos-algms, thank's for the elaborate issue and reproduction! But I'm a little bit confused, because if it wouldn't emit the Also in your codesandbox you do a lot with timeouts inside of the callbacks, accessing the values after the might have been changed again by viselect. Could you elaborate what you believe is the issue here? Is it that you would expect |
Hey, thanks for investigating it 😊. The {
"added": [],
"removed": [
"A"
],
"stored": [
"A" // note even tho it was removed, it's still included here.
]
} and it should be {
"added": [],
"removed": [
"A"
],
"stored": [] // I'd expect it to be empty, as it is the last event I'll receive.
} I put a timeout there to check the internal state is updated after some time, and |
Aaah, I see! I get why this might be confusing and I'd really like to change it. Even though this is not expected, it's a somewhat "minor" breaking change. I'll have to have a closer look at it to not break anything else (back then I didn't set up E2E tests so any change to such a core thing is critical). I'm currently on vacation but will have a look at it! Thank you again for your clarification :) |
What is the problem?
Clicking on an element to select it and then clicking again to unselect it doesn't trigger the events
move
andstop
events.it can be fixed by removing the
if
selection/packages/vanilla/src/index.ts
Lines 805 to 807 in bee9f2f
Please provide the steps to reproduce and create a CodeSandbox.
https://codesandbox.io/p/sandbox/ynjtdj
Also, check the
console.log
Check the events were NOT triggered.
What is the expected behavior?
It should trigger the
move
andstop
events andstop
should contain the rightstored
data so we can trust it.The text was updated successfully, but these errors were encountered: