-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AccessibleValueHandler] add option to map value before setting Property value #669
Comments
I renamed the PDOM value mapper and created |
Please also note 278bd57 while reviewing. |
While working on phetsims/ratio-and-proportion#175, I have asked myself the following question three times: "Why have this "map" function? Why not just use constrain value?" I'll answer it again explicitly here for the record, even though it is reiterating from the original comment in this issue. While the placement in AccessibleValueHandler makes me think that it could be interchangable, constrainValue is an option in Slider, so it is important to keep the same function signature for that function. this new "a11yMapValue` function has the flexibility of parameters we need to pass for particular a11y cases (like shiftKey). |
Changes look good, and see the change at 278bd57. I am curious though if this could have been handled by the |
Also, |
Yeah good idea. Let's simplify the API as we can. No need to add mutation until there is a good reason to. |
roundToStepSize is not quite enough functionality, because for Ratio and Proportion we needed to also support snapping directly to a value in between snaps that would create the "in proportion" state. That was important for usability and modality equity. Anything else here? |
OK, thanks for clarifying, understood. Closing. |
Over in phetsims/ratio-and-proportion#175, we need a bit more control over the valueProperty being set by AccessibleValueHandler. We need to detect a case before setting the value. I think the best way to do this is to create a new option that is called before
constrainValue
is called. I thought about alteringconstrainValue
, but since Slider.js supports that option, it would be best to keep the implementations consistent between Slider and AccessibleValueHandler.The text was updated successfully, but these errors were encountered: