Skip to content

New reference panel: keep collapse state for lists across rerender/remounts

Warren Gifford requested to merge mrn/keep-collapsed into main

Created by: mrnugget

This fixes #33418 (closed) by doing manual management of the collapse state in the top component. That allows us to keep the state across re-renders and re-mounts, which is what happens when a location is clicked on.

Note for reviewers: the diff is quite busy. Review without whitespace changes. It's essentially just 10 lines. The managing of the state in the top-most component and changing <Collapse /> invocations to use that state.

But I also decided to get rid of the activeLocation being passed down, because I ran into this while debugging the re-renders/re-mounts. And I also changed the props so they're easier to separate.

Test plan

Manual local testing.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading