-
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
RectangularRadioButtonGroup does not respect touchAreaDilation options #856
Comments
I have a potential workaround to pass through the pointer dilations to the children, but it would likely clash with fff91db and #708 Subject: [PATCH] Expand touch areas, see https://github.com/phetsims/center-and-variability/issues/462
---
Index: js/buttons/RectangularRadioButtonGroup.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/buttons/RectangularRadioButtonGroup.ts b/js/buttons/RectangularRadioButtonGroup.ts
--- a/js/buttons/RectangularRadioButtonGroup.ts (revision 036005add1db1fe57725e4e98dd469d1a8d97e35)
+++ b/js/buttons/RectangularRadioButtonGroup.ts (date 1692742579427)
@@ -221,6 +221,12 @@
if ( item.voicingContextResponse ) {
radioButtonOptions.voicingContextResponse = item.voicingContextResponse;
}
+ if ( options.touchAreaXDilation ) {
+ radioButtonOptions.touchAreaXDilation = options.touchAreaXDilation;
+ }
+ if ( options.touchAreaYDilation ) {
+ radioButtonOptions.touchAreaYDilation = options.touchAreaYDilation;
+ }
const radioButton = new RectangularRadioButton( property, item.value, radioButtonOptions );
|
This might be good to pair on sometime. sun/js/buttons/RectangularRadioButtonGroup.ts Lines 283 to 295 in 08180ca
|
What if we comment out the code in #856 (comment) and apply the patch in #856 (comment) ? it works well when the buttons are the same size. When the buttons are different sizes, are you saying we would compute a different dilation for each so they will have the same touch or mouse areas on startup? But they could change size at runtime based on dynamic strings. Would it be OK if 2 radio buttons with different sizes have different touch areas? That would simplify things if it is OK. |
Rather than every sim having to dilate pointer areas for the buttons in RectangularRadioButtonGroup, it might be nice if the pointer areas were auto-dilated to fill the space between the buttons. This would be consistent with AquaRadioButtonGroup and CheckboxGroup, and would make sims consistent. |
In phetsims/center-and-variability#462 it was decided that this is not blocking for CaV. Self-unassigning, but I would recommend review at the next iteration planning in case we want to schedule it. |
Please see notes from @pixelzoom in phetsims/projectile-data-lab#187 (comment) and below |
Dev Meeting 3/7/24
|
…nd patching AquaRadioButtonGroup for horizontal cases, see #856
@samreid I believe this is resolved with the above commit, can you confirm? |
…ointer areas and focus highlight, see #856, #851, #852, phetsims/greenhouse-effect#349
I confirmed the behavior is good, and the first commit f80ffeb is great. However, I don't feel like I can evaluate the second commit ce5d930. It overlaps with work done by @jessegreenberg in: fff91db @jessegreenberg are you available to complete this review? |
Probably related to #851. In phetsims/center-and-variability#462, I was asked to dilate the pointer areas for the radio button groups, but the option is not being respected.
Probably being overwritten in
sun/js/buttons/RectangularButton.ts
Lines 180 to 205 in 56a5f02
So this may have been broken in 21fb64f as part of #48.
The text was updated successfully, but these errors were encountered: