phetsims / resistance-in-a-wire

"Resistance in a Wire" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/resistance-in-a-wire
GNU General Public License v3.0
1 stars 4 forks source link

Not getting slider alerts #213

Closed jessegreenberg closed 3 years ago

jessegreenberg commented 4 years ago

Noticed while working on #212, I am not seeing any alerts in this sim other than "reset" alert in the a11y view.

jessegreenberg commented 4 years ago

It looks like the alerts that are getting used in startDrag and endDrag are being overridden in SliderUnit after changes that were needed for #210.

jessegreenberg commented 4 years ago

This diff seemed to fix it but I am not sure what is best, can you take a look @zepumph?

diff --git a/js/resistance-in-a-wire/view/SliderUnit.js b/js/resistance-in-a-wire/view/SliderUnit.js
index 81d24cc..6875be2 100644
--- a/js/resistance-in-a-wire/view/SliderUnit.js
+++ b/js/resistance-in-a-wire/view/SliderUnit.js
@@ -67,14 +67,14 @@ function SliderUnit( property, range, symbolString, nameString, unitString, labe
   }, options );

   // override the start and end drag functions in the options
-  const providedStartDragFunction = options.sliderOptions.startDrag;
+  const providedStartDragFunction = options.startDrag;
   options.sliderOptions.startDrag = function( event ) {
     if ( event.type === 'keydown' ) {
       self.keyboardDragging = true;
     }
     providedStartDragFunction && providedStartDragFunction();
   };
-  const providedEndDragFunction = options.sliderOptions.endDrag;
+  const providedEndDragFunction = options.endDrag;
   options.sliderOptions.endDrag = function() {
     self.keyboardDragging = false;
     providedEndDragFunction && providedEndDragFunction();
terracoda commented 3 years ago

This is still an issue. I am not getting context responses when adjusting the sliders in the A11y View or when using Voice Over.

terracoda commented 3 years ago

I was using was 1.70-dev.4 on PhET Marks.

jessegreenberg commented 3 years ago

This is my fault, I forgot to assign, apologies. Anyway, I reviewed #210 and https://github.com/phetsims/resistance-in-a-wire/commit/3dea6fc91241899736a1b79a29b97b16d979a7e2 and I am pretty certain that https://github.com/phetsims/resistance-in-a-wire/issues/213#issuecomment-609973260 is correct.

jessegreenberg commented 3 years ago

This is fixed with the above commit @terracoda can you please verify?

terracoda commented 3 years ago

Thank you @jessegreenberg. The context responses are firing now :-)