Closed pixelzoom closed 3 years ago
Dialog extends Popupable( Panel ). Popupable calls phet.joist.sim.showPopup. So Sim showPopup
is where this should be handled. Probably by calling this.rootNode.interruptSubtreeInput()
if isModal
.
The first thing I did (in the above commit) was to clean up Sim showPopup
and hidePopup
. Specifically, I renamed parameter node
to popup
, and improved the overall documentation.
I added this.rootNode.interruptSubtreeInput
in the above commit, and that seems to have the desired effect. I'm not certain, but I probably also could have called this.display.interruptInput
.
@jonathanolson please review, feel free to change if there's a better way. Review is high priority and blocks publication, since this is a significant change to Sim.js.
Looks great to me, and looks like the right approach. Thanks!
Opening a modal dialog does not currently interrupt other user interactions. For example, with multitouch, I can be dragging a slider, open a modal dialog, and continue dragging the slider. And it does not seem like this should be the responsibility of the client.
A modal dialog is (by definition) supposed to prevent the user from interacting with the reset of the application until the dialog is closed.