Closed KatieWoe closed 2 years ago
This bug is a result of listener order trouble and because the focus event comes before the Property is changed:
Note that the focus event will come first (thus the object response for the button) https://github.com/phetsims/sun/blob/8b4861fd80122b2026b92815763b65222a74c96b/js/ComboBoxListBox.js#L70-L75
Then the Property is changed, and allows the listener to fire to change the object response to the new value: https://github.com/phetsims/joist/blob/66006a5c4b497c19bd1180bb79082664a4b010d8/js/preferences/VoicingPanelSection.js#L444-L455
I feel a bit like this has to do with https://github.com/phetsims/sun/issues/701, where we need a hook that the item has just changed, but also the timing is all off, so we may have to spin up our own internal. I'll prototype this, but tagging @jessegreenberg so he is aware.
This patch is a potential solution build into ComboBox, but it is a one-off just for voicing.
Basically the main issue is the the focus changes before the Property changes. If we can get rid of that need, and focus after the Property has changed, then we can still handle this from outside of ComboBox, but otherwise, I don't see a large value in creating a general hook that is added before the Property has changed.
Here is the doc that briefly discussed why we focus before the Property change. @jessegreenberg, do we have to do this? Do you remember why it is like this?
@jessegreenberg and I worked on this, and fixed it in master. @KatieWoe can you please test on master.
On Firefox, the whole sim freezes when you turn on voicing
Thanks @KatieWoe, looks like an unrelated issue with Voicing in Firefox after https://github.com/phetsims/scenery/issues/1288
This should be fixed now. @KatieWoe can you please try again to see if this is fixed?
Looks fixed on master
Thanks!
I am seeing this issue again in https://github.com/phetsims/qa/issues/791 with iOS 15.4 + Safari.
Ignore my big hand in this video!
Thanks @Nancy-Salpepi - what you are showing looks a bit different than the original post. The original issue was related to the wrong voice right after making a ComboBox selection but this appears to be the entirely wrong voice for all subsequent interactions. Moving this comment to utterance-queue.
Test device Dell Operating System Win 11 Browser Firefox Problem description For https://github.com/phetsims/qa/issues/717. When switching between the voicing options, the voice that is read out seems to be the one you were on previously, not the new one you switched to.
Visuals
https://user-images.githubusercontent.com/41024075/139108522-3d728c7a-42ee-4817-af05-e09ff7e5ebd3.MOV
Troubleshooting information: <details
!!!!! DO NOT EDIT !!!!! Name: Friction URL: https://phet-dev.colorado.edu/html/friction/1.6.0-dev.19/phet/friction_all_phet.html Version: 1.6.0-dev.19 2021-10-08 22:59:15 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0 Language: en-US Window: 1280x667 Pixel Ratio: 1.5/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 Vendor: Mozilla (ANGLE (Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0)) Vertex: attribs: 16 varying: 30 uniform: 4096 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 32767x32767 OES_texture_float: true Dependencies JSON: {}