-
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
Add "display mode" to ComboBox #451
Comments
This will involve instrumenting ComboBoxButton, which is currently not implemented. |
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
Implemented in the above commits. While implementing this, I decided that this.displayOnlyProperty = new BooleanProperty( false, {
tandem: options.tandem.createTandem( 'displayOnlyProperty' ),
phetioDocumentation: 'disables interaction with the ComboBox and makes it appear like value display'
} ); Here's how it looks in Studio with Beer's Law Lab. First with Here's how it looks where set to @ariel-phet please assigning someone to review. |
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
phetioDocumentation was revised to: phetioDocumentation: 'disables interaction with the ComboBox button ' +
'and makes it appear like a display that shows the current selection' |
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
@chrisklus and I reviewed and it looks great, we made minor modifications above. Back to @pixelzoom to sign off on the minor changes. Close if all is well. |
👍 @samreid FYI, it looks like a bunch of commit above are for some other issue with title "Remove whitespace from tandem strings". Up to you whether to tag those commits with the correct issue number. Closing. |
Reopening. I think this Property may be misplaced. It should probably be a Property of ComboBox, not ComboBoxButton. And in addition to changing the look of ComboBoxButton, it should hide the listBox. @samreid your opinion? |
I believe this patch is all we need: Subject: [PATCH] Update range for TEMPERATURE_CELSIUS_LATITUDE, see https://github.com/phetsims/least-squares-regression/issues/92
---
Index: js/ComboBox.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/ComboBox.ts b/js/ComboBox.ts
--- a/js/ComboBox.ts (revision 46abda161799f96f2d7c6c0c25daab94b138f973)
+++ b/js/ComboBox.ts (date 1734987456575)
@@ -458,6 +458,12 @@
// support for binder documentation, stripped out in builds and only runs when ?binder is specified
assert && window.phet?.chipper?.queryParameters?.binder && InstanceRegistry.registerDataURL( 'sun', 'ComboBox', this );
+
+ // TODO: Remove this test harness, see https://github.com/phetsims/sun/issues/451
+ // eslint-disable-next-line phet/bad-sim-text
+ setInterval( () => {
+ this.displayOnlyProperty.value = !this.displayOnlyProperty.value;
+ }, 5000 );
}
public override dispose(): void {
Index: js/ComboBoxButton.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/ComboBoxButton.ts b/js/ComboBoxButton.ts
--- a/js/ComboBoxButton.ts (revision 46abda161799f96f2d7c6c0c25daab94b138f973)
+++ b/js/ComboBoxButton.ts (date 1734987428631)
@@ -313,11 +313,12 @@
/**
* Sets the button to look like a value display instead of a combo box button.
* See https://github.com/phetsims/sun/issues/451
- * TODO: What does the PDOM look like when set to displayOnly? https://github.com/phetsims/sun/issues/451
*/
public setDisplayOnly( displayOnly: boolean ): void {
this.arrow.visible = !displayOnly;
this.separatorLine.visible = !displayOnly;
+
+ this.tagName = displayOnly ? 'p' : 'button';
}
/**
Note this patch has a test harness in it, you can launch in http://localhost/center-and-variability/center-and-variability_a11y_view.html?brand=phet&ea&debugger, open the preferences => Simulation, and see the a11y view change from button to p. @zepumph does this look right to you? Anything else for this issue? If you commit, please remove the test harness tagged for removal with a TODO. |
UPDATE: Please see further investigation in #617 (comment) |
I got to a commit point. I was able to test that this sounds good for nvda, and that studio correctly behaves when toggling displayOnly mode. Here is the test code I used at the bottom of the ComboBox constructor:
|
I reviewed the commit and it looks good to go, closing. |
I see this assertion in Buoyancy phet-io fuzzing that is likely from this:
|
I think that will clean up CT, but I'll check back in a few columns. |
All fixed up, and I tested manually also by toggling displayOnly mode in studio when the list box was open. Closing |
1/17/19 phet-io meeting, requested by @kathy-phet:
Add
{BooleanProperty} singleItemDisplayProperty
, defaultfalse
. Hides the arrow and vertical separator on the ComboBoxButton, and set'spickable: false
on the ComboBox.The text was updated successfully, but these errors were encountered: