phetsims / circuit-construction-kit-common

"Circuit Construction Kit: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
10 stars 10 forks source link

Deleting a vertex using the keyboard in the state wrapper did not update #901

Closed samreid closed 1 year ago

samreid commented 1 year ago

Discovered in https://github.com/phetsims/circuit-construction-kit-common/issues/839, Deleting a vertex using the keyboard in the state wrapper did not update the upstream sim. But the vertex split in the downstream sim. So the upstream sim was left in a broken state.

jessegreenberg commented 1 year ago

This is happening because sim code in the downstream sim is setting focus to something within its window. So key presses are getting dispatched to the downstream sim instead of the upstream sim. The problem goes away if you focus the upstream sim with the dev tools.

I believe https://github.com/phetsims/joist/issues/750 is the right long term fix for this issue. When focus follows the mouse and the upstream sim receives focus as you interact with it, this problem won't happen. That will be an "epic" level issue and isn't slated for work soon. In a zoom call today a short term workaround was identified but if that doesn't remain an acceptable fix, please let me know.

samreid commented 1 year ago

Today's workaround seems like it is working well, and good enough to unblock publication. Closing.