-
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
How to handle enabled in Node #1112
Comments
Additionally, we decided sims should not be published until buttons have "disabled/grayscale". I'm not sure if that is tracked elsewhere, but I'll mark this as blocks-publication for now. |
Perhaps you are thinking of phetsims/sun#658? |
…onentEnabledListener(), phetsims/scenery#1112
…onentEnabledListener(), phetsims/scenery#1112
…onentEnabledListener(), phetsims/scenery#1112
…onentEnabledListener(), phetsims/scenery#1112
…onentEnabledListener(), phetsims/scenery#1112
During developer meeting we all agreed that having default enabled behavior in Node was problematic. Today I hoped to make improvements to Node, by removing the default and moving a to centralized sun component listener for most of the cases that were covered by EnabledNode prior to #1100. @jonathanolson, I don't think we are done yet, but I feel like this was the most important blocking work to be done. Please review , especially |
Looks like it's on the right path, but I will want to discuss how we can override this behavior on a subtype or specific component instance level. |
In phetsims/sun@7d5cc3e, I converted ButtonNode to an overridable enabled strategy. I'll do the rest of them now. |
…ns in each sun component, phetsims/scenery#1112
…ns in each sun component, phetsims/scenery#1112
…ns in each sun component, phetsims/scenery#1112
Above, we now have an option allowing overriding of any enabled appearance strategy. @jonathanolson, I feel like all is done here, or separated out in to other issues. Will you please review this (and note the work also done over in phetsims/sun#658. Anything else here? |
I don't think this needs to be labelled for meeting anymore. |
Looks great here, thanks! |
…onentEnabledListener(), phetsims/scenery#1112
…ns in each sun component, phetsims/scenery#1112
Over in #1100, enabledProperty was moved to Node. Currently, default logic is hard coded in
Node.onEnabledPropertyChange
to do one thing, but it isn't flexible:The only way to change this behavior currently is to override this method.
In a discussion today with @jonathanolson, multiple problems were pointed out with this pattern.
this.pickable = enabled;
is not the way we want to handle disabling input generally. This is because certain components, like buttons, may have particular input listeners that may still want to fire on a disabled component. We cannot make this assumption in Node.js that would effect all Nodes. @jonathanolson mentioned potentially having PressListener generally respect enabled, but I'm not sure we actually felt like that was a reasonable approach.1
, and assuming that pickable should be true (see Should Node.enabledProperty respect pickable:null? #1105). This is not a reasonable assumption.enabledProperty.link
, which found lots of spots that were using logic different from this standard, hard-coded logic we centralized sun components around. We need a way to be flexible to all enabled needs of components.cursor
in some standard way? (UPDATE: oh, I see that was actually removed as part of phetsims/sun@add7c94)I think we should discuss at dev meeting. @jonathanolson has brought up many good points. I also think it deserves a high priority to make sure that unstable code doesn't sit in Node for too long.
The text was updated successfully, but these errors were encountered: