phetsims / projectile-motion

"Projectile Motion" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
15 stars 13 forks source link

Clicking NumberDisplay should not summon keypad if corresponding edit button is hidden #253

Closed arouinfar closed 3 years ago

arouinfar commented 3 years ago

For #244

The five controls under projectileMotion.labScreen.view.projectileControlPanel.customControl all have a NumberDisplay + edit button. Clicking either of these will summon the keypad.

When editButton.visibleProperty is false, it should not be possible to summon the keypad. However, the NumberDisplay remains pickable which is problematic.

zepumph commented 3 years ago

I created a new Property called editEnabledProperty, and it controls the enabled and the button and the numberDisplay's input listener. The editButton.enabledProperty is now a linked element. Note that NumberDisplay doesn't have this same behavior because by default (in their common code) they don't support input.

Please review.

arouinfar commented 3 years ago

I created a new Property called editEnabledProperty

This is really nice. The behavior looks good in master, thanks!