Closed samreid closed 2 years ago
I made initial progress on this, but did not fully visit transitive parts like ExpandCollapseButton, and ran into problems around ACCESSIBLE_NAME_BEHAVIOR
. @jessegreenberg can you please advise or take a look on ACCESSIBLE_NAME_BEHAVIOR
?
I'm in this file working on https://github.com/phetsims/sun/issues/743 right now. I'll take this on.
I made various improvements, and some of them bled outside of AccordionBox. I fixed the typing for Behavior functions. @samreid please note an any
waiting on Button options,
I also removed AccordionBoxOptions from phet-types. It was a total headache because phet-types wasn't the only spot where options for common code was being declared. It was hard to track down.
@samreid and @chrisklus, I changed code in you sims. Please be aware and let me know if you see any trouble. My main goal was to get things compiling, but I also tried to use the latest TypeScript patterns we have.
@samreid, is there anything else left here?
I skimmed the commits, taking a closer look at the changes in CCK and everything seemed good. There is one TODO listed for this issue remaining:
// @ts-ignore TODO: private in the same file, but not private in the same class, https://github.com/phetsims/sun/issues/738
( node as AccordionBox ).expandCollapseButton.accessibleName = accessibleName;
Some solutions would be:
expandCollapseButton
publicACCESSIBLE_NAME_BEHAVIOR
inside the classTo me, it makes sense that an AccordionBox's expandCollapseButton
would be public. Sound OK?
Yes, making expandCollapseButton public doesn't bother me in the slightest, but the second approach has been done elsewhere, and it makes the most sense in this case. I don't want to make the button public unless I had a use case that called for it. Feel free to make that happen if you'd like though! I'm ready to close.
That seems great, thanks! Closing.
For https://github.com/phetsims/center-and-spread/issues/6, it would be nice to have AccordionBox in TypeScript.