Closed jessegreenberg closed 3 years ago
I removed the assertion and made it so we only focus these Nodes when they are focusable. I want to make sure @zepumph is OK with this change since we discussed adding these assertions together initially in #719. @zepumph assigning you to review or lets take a look tomorrow during dev meeting.
That looks great to me thanks. Ready to close, but I want to make sure you note this behavior while reviewing https://github.com/phetsims/sun/issues/724 to make sure that won't cause the same trouble.
OK thanks! Will keep an eye out in #724 but I think this can be closed.
In https://github.com/phetsims/sun/issues/719 we added assertions that say when a Popupable closes, focus must go somewhere and the target must be focusable.
But it is crashing in a case demonstrated in https://github.com/phetsims/fourier-making-waves/issues/207. In this case, the ScreenView loads with focus on its
h1
Node. On the first mouse/touch press on an AmplitudeNumberDisplay the Dialog is shown and Popupable stores theh1
Node to focus later. Theh1
Node is immediately removed from the focus order. We might have set the AmplitudeNumberDisplay as thefocusOnHideNode
but they are currently explicitly removed form the traversal order. We also shouldn't have to, the default focus behavior for Popupable would work well in this case except for this first mouse press into the sim.I am going to remove the assertion for now.