-
Notifications
You must be signed in to change notification settings - Fork 6
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
Moving zoom slider or launching reenables zoom buttons #394
Comments
The code that causes the behavior is this: // add disabling effect for buttons
if ( isIncrease ) {
// plus button
scaleProperty.link( scaleValue => this.setEnabled( scaleValue !== range.max ) );
}
else {
// minus button
scaleProperty.link( scaleValue => this.setEnabled( scaleValue !== range.min ) );
}
|
I don't think this is a reasonable customization, and I'm not bothered by the odd outcome. One of the client requests is to set the zoom level and disable or hide it, and we instruct them to disable each part of the zoom control. A better user experience would be to have something like
That is a serious issue, but I am unable to reproduce it in master. @KatieWoe can you reproduce in master? |
The values are saved in the state, but overridden when the slider value changes. When the slider state is loaded in the sim, the values is changed, and the buttons enable/disable accordingly. The rule for the sim is that if the slider is at min or max, that button should be disabled. Otherwise the buttons should be enabled. This rule is enforced whenever the slider value changes. Therefore, this is basically the came cause and effect as in #392 (comment), and we have similar options:
@arouinfar can you please advise? |
The odd behavior arises from an incomplete/unrealistic customization, so I am fine with leaving things as-is @samreid. |
I'm not so sure it's unrealistic. A user might set a custom zoom and then disable the controls for the user. This wouldn't work and it did seem to be requested. Or am I misunderstanding? |
I thought weird things happen because the zoom controls weren't fully disabled (just the buttons, not the slider). If you want to prevent users from changing the zoom level, both the buttons and the slider need to be disabled. |
Yes, but adjusting the slider, then disabling the slider + buttons, then pressing "preview sim", re-enables the buttons (and the slider stays disabled). |
Ah, I missed the part about disabling the slider too. This is definitely publication-blocking. @samreid would this issue be circumvented by adding something like |
In the commit, I instrumented zoomControl.enabledProperty and marked the slider and buttons as phetioReadOnly: true. Can you please review/test? |
@samreid that seems to have done the trick. I cannot reproduce using the steps outlined in #394 (comment) (using the new Since lots of the parts of the ZoomControl are now read-only, I think it makes sense to unfeature them in the overrides.
I'll also need to update the client guide entry about the zoom level. |
@samreid the above commits are ready for cherry-picking. |
I also had to cherry pick the scenery commit phetsims/scenery@9bf35fe to make this work. |
I cherry picked the sim and common repo changes, will be ready for testing in next RC. |
This can be confirmed by checking that e.g., |
Device
Dell
OS
Win 10
Browser
Chrome
Problem Description
For phetsims/qa#657..
When zoom buttons are disabled, but the zoom slider is not, moving the slider reenables the buttons. Using the buttons while the slider is disabled does not seem to reenable the slider.
Visuals
EDIT
More significantly, the buttons reenable when the sim is launched, meaning this doesn't seem to be saved in state.
The text was updated successfully, but these errors were encountered: