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

cursor for Diameter and Mass controls #239

Closed pixelzoom closed 3 years ago

pixelzoom commented 3 years ago

In master, I noticed that for the Diameter and Mass NumberControls (example below), mousing over the NumberDisplay changes the cursor to 'pointer'. Pressing on these displays doesn't do anything (I thought it might open a Keypad). This happens in the Vectors and Drags screens, but not in the Lab screen. And other NumberControls in the sim don't behave like this. This occurs in master, but not in the published version (1.0.15).

screenshot_682
jbphet commented 3 years ago

There was an explicit spec to set the cursor to pointer in ProjectileMotionConstants.NUMBER_DISPLAY_OPTIONS that was causing this behavior. I've removed it, and the problem appears to be fixed.

This was most likely introduced in https://github.com/phetsims/projectile-motion/commit/364d34e41c1113ddca9718be7f6f331a1f8af106, where some work was done to incorporate standard number displays instead of custom ones. I scanned through the commit, and I'm not entirely sure why the behavior changed, since there was an explicit spec for setting the pointer in the old code too. I can see why this setting got pulled into the common options. I could spend the time to figure it all out, but it doesn't seem worth it, since it's easy enough just to correct the problem.

There is a case where it is possible to click on a number display and bring up a keypad, and it's when the "Custom" mass is selected on the "Lab" screen. I tested this and verified that it still works correctly.

jbphet commented 3 years ago

@pixelzoom - Does this look like a reasonable fix to you?

pixelzoom commented 3 years ago

Code and behavior looks good to me, closing.