ibm-products icon indicating copy to clipboard operation
ibm-products copied to clipboard

Investigate standardization of controllable state

Open elycheea opened this issue 3 years ago • 2 comments

This issue is based on a suggestion from @janhassel in #1521.

What will this achieve?

Provide a more consistent approach for handling optional state (e.g. open on OptionsTile or SidePanel).

Additional information

Carbon’s useControllableState hook

elycheea avatar Jan 19 '22 19:01 elycheea

@elycheea can we add further information regarding what is to be done and which components this impacts on?

lee-chase avatar Mar 23 '22 13:03 lee-chase

@lee-chase At a glance, it looks like the Carbon hook is used in Toggle, ContentSwitcher, Tabs but not Accordion 🤔 so I’ll look into it a bit more and add more detail here.

elycheea avatar Mar 23 '22 13:03 elycheea

Still looks as though useControllableState, from Carbon is used in Toggle, ContentSwitcher, and Tabs. I can start by looking into incorporating it into OptionsTile which was requested (see here).

matthewgallo avatar Nov 10 '22 19:11 matthewgallo

Will add to side panel as well.

elycheea avatar Nov 14 '22 16:11 elycheea

After looking at this further, I think SidePanel is somewhat different because the panel is triggered from an element outside of itself. Whereas, the OptionsTile is triggered from itself. Because of this, I don't think useControlledState is something that the SidePanel needs to use.

matthewgallo avatar Nov 14 '22 18:11 matthewgallo