-
Notifications
You must be signed in to change notification settings - Fork 1
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
Releasing 2 chocolate bars above/below the same stack can result in improper stacking #323
Comments
I can duplicate this, but it requires a bit more specific sequence:
|
I've committed a proposed fix for this issue. The problem was with the positioning that occurred in the item-added listener for the snacks on the plate, because it wasn't taking into account the possibility that a previously added snack could be in the process of being dragged. I regression tested a number of different scenarios and didn't see any problems. This isn't a big delta in terms of the number of lines changed, but it is a different way of deciding where the candy bar should go, so should be reviewed carefully. I a little concerned that there was some history for why it was being done this way before. Assigning to @marlitas for review. |
The only scenario I can think of that could potentially be buggy is if this listener fires and another candy bar has it's I don't have an easy way to test this scenario... but I also don't think it's possible. I'll send to @jbphet to confirm, but otherwise I think this change looks good and seems robust. |
Apparently my brain was quite fuzzy when I was looking at this. This creates problems in the state wrapper right away. I'm going to revert the above commit. @jbphet and I should check in. |
Mea culpa for not checking the state wrapper - I always forget that. I've redone the change so that it will handle the phet-io-instigated situation where the add-item-listener is being fired after several things have been added, and not as each is added. I've tested it locally for the typical mouse-driven usage, the problematic multi-touch cases, and in the state wrapper, and it seems to be working correctly. I think it's ready for review again. |
This is looking good. I went through the code, did some testing and this seems like a strong way to address the problem. Thanks for your work on this @jbphet! I'll send this over to @Nancy-Salpepi to confirm all looks well on main. Feel free to close. |
Looks great on main! Closing. |
Test device
iPad 9th generation
Operating System
iPadOS 17.5.1
Browser
Safari
Problem description
For phetsims/qa#1105, on the Distribute Screen if I release 2 bars at the same time above or below a stack, they will stack in the same spot, leaving a space in the stack. Touching the "floating" bar will fix the problem.
Steps to reproduce
Visuals
RPReplay_Final1720724329.mov
The text was updated successfully, but these errors were encountered: