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

Address TODO about propagating options to button model. #749

Open
pixelzoom opened this issue Apr 8, 2022 · 2 comments
Open

Address TODO about propagating options to button model. #749

pixelzoom opened this issue Apr 8, 2022 · 2 comments

Comments

@pixelzoom
Copy link
Contributor

This NOTE was added by @jonathanolson when he converted RectangularPushButton to TypeScript. It should have been a TODO, with an issue. The same problem needs to be addressed in RoundPushButton, and any other sun button that propagates all of its options to its model class. It's unlikely that there's a TODO in every location where this needs to be addressed.

// NOTE: Let's not create PushButtonModel with these options?
export type RectangularPushButtonOptions = SelfOptions & RectangularButtonOptions & PushButtonModelOptions;
@samreid
Copy link
Member

samreid commented Dec 10, 2024

It's not really clear what the TODO means here, @pixelzoom or @jonathanolson can you clarify?

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Dec 10, 2024

Passing the same options to super and a subcomponent is an anti pattern. For example, superOptions in RectangularPushButton:

50     const pushButtonModel = new PushButtonModel( superOptions );
51 
52     super( pushButtonModel, new PushButtonInteractionStateProperty( pushButtonModel ), superOptions );

@pixelzoom pixelzoom assigned samreid and unassigned jonathanolson and pixelzoom Dec 10, 2024
@samreid samreid assigned samreid and unassigned samreid Dec 10, 2024
samreid added a commit that referenced this issue Dec 10, 2024
@samreid samreid removed their assignment Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants