phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Outgoing nucleons cleared when more than one decay happens consecutively #55

Closed Luisav1 closed 2 years ago

Luisav1 commented 2 years ago

@chrisklus and I saw that when more than one decay happens that changes the mass number (alpha decay, neutron emission, or proton emission), any outgoing particles are cleared out. This behavior is only expected when the undo decay button is pressed.

This is happening because whenever anything in the atom changes, we are assuming that the user is doing that change. So we hide the undo decay button. The problem is that when we hide the undo decay button, we give it the same behavior as if the undo decay button was clicked - clearing out any outgoing particles.

@ariel-phet We ran into this issue but we think we have a solution.

Luisav1 commented 2 years ago

@chrisklus and I fixed this in the above commit. We move the code that was clearing out the particles to the undo decay button listener so it's all done together.

chrisklus commented 2 years ago

For QA: Please close if this is fixed, and reach out to me or @Luisav1 if any clarification is needed. Thanks!

Nancy-Salpepi commented 2 years ago

This looks good to me in 1.0.0-rc.10 (tested with He-10 and Fr-197 and compared with 1.0.0-rc.8).