Closed zepumph closed 4 years ago
@zepumph I pushed some changes to accomplish this. Would love your review. I noticed two different ways to handle the startDrag
and stopDrag
options between RIAW and Ohm's Law. I kept both for now, but would particularly love your advice about whether to condense down to a single way to handle these options.
Review:
shiftKeyboardStep
and keyboardStep
declared in ControlPanel are the same as the default in SliderUnit, so they aren't needed.a11yMapValue: value => Util.toFixedNumber( value, options.decimalPlaces ),
Overall things are looking really good. Thanks for taking the lead on this. Let me know if you have any questions.
Just pushed a change that should hopefully resolve the CT error documented in #211. Apologies again for not fixing this earlier @zepumph @pixelzoom! I'll keep an eye on CT to make sure the error is resolved with this change.
@zepumph regarding the startDrag
and endDrag
options, I've moved them back to the top level options. I think I understand the piece you're referring to from NumberControl (where we used options.delta in the sliderOptions), but would appreciate you checking over this change to confirm that it's consistent with the structure you were imagining.
In terms of gracefully wrapping the options, I'm not sure whether that favors the Ohm's Law or the RIAW handling of startDrag and stopDrag -- can we discuss Tuesday?
n terms of gracefully wrapping the options, I'm not sure whether that favors the Ohm's Law or the RIAW handling of startDrag and stopDrag -- can we discuss Tuesday?
Yes indeed. I think that for the most part I was looking at RIAW and trying to make sure we didn't lose functionality. Now looking at OL, it is more idiomatic to what was done in NumberControl, and makes more sense because it only uses a single option. I will get back to you about the best pattern.
Other changes look good.
I think wrapping the options is the best holdover pattern until https://github.com/phetsims/scenery/issues/1016 or https://github.com/phetsims/sun/issues/536 are figured out.
This is also the case for ohms-law, and I think they could both be implemented in a very similar way. @twant said she would investigate. Thanks!
Perhaps something like: