Skip to content
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

Sometimes the RoundStickyPushButton highlights wrong #228

Closed
samreid opened this issue Dec 11, 2018 · 5 comments
Closed

Sometimes the RoundStickyPushButton highlights wrong #228

samreid opened this issue Dec 11, 2018 · 5 comments

Comments

@samreid
Copy link
Member

samreid commented Dec 11, 2018

Discovered during #227. Sometimes the highlight looks like "pressed" instead of "shiny"

button-highlight

@samreid
Copy link
Member Author

samreid commented Dec 11, 2018

It seems that StickyToggleButtonInteractionStateProperty.buttonModel.looksPressedProperty is somehow true for this case, will require further investigation.

@samreid
Copy link
Member Author

samreid commented Dec 11, 2018

Here's the docs for looksPressedProperty

    // @public - This Property was added for a11y. It tracks whether or not the button should "look" down. This
    // will be true if downProperty is true or if an a11y click is in progress. For an a11y click, the listeners
    // are fired right away but the button will look down for as long as PressListener.a11yLooksPressedInterval.
    // See PressListener.click for more details.
    this.looksPressedProperty = new BooleanProperty( false );

Assigning @jessegreenberg for investigation.

@jessegreenberg
Copy link
Contributor

Oops, sorry for the hassle. This is related to phetsims/ph-scale#71. The button looks pressed because StickyToggleButtonModel.downProperty is still true after the toggle button's valueProperty is set by the sim.

This was fixed in ph-scale by updating the downProperty with the valueProperty in MomentaryButtonModel. We need to do the same in StickyToggleButtonModel as well as any other subtypes of ButtonModel where you can control the button value Property and expect the button view to update accordingly.

Ill create an issue in sun to search for these.

@jessegreenberg
Copy link
Contributor

This should be fixed in master, @samreid can you please confirm?

@samreid
Copy link
Member Author

samreid commented Dec 12, 2018

I can't seem to break it any more, thanks for the fix!

@samreid samreid closed this as completed Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants