react-timelines icon indicating copy to clipboard operation
react-timelines copied to clipboard

Hide no subtracks

Open yorickreum opened this issue 5 years ago • 1 comments

See subject, don't show expansion button / + button when there are no subtracks.

yorickreum avatar May 25 '19 18:05 yorickreum

As @willbamford has mentioned on https://github.com/JSainsburyPLC/react-timelines/pull/103#discussion_r287817534

I'm not sure you can rely on this as tracks can be dynamically loaded i.e. only loaded in when you hit toggleOpen (could be wrong - been a while since I looked at this code)

A track's isOpen status is passed into the component (and not held in an internal state), along with a callback that is triggered when the track's expand button is pressed. Using this callback, implementations could asynchronously load track data in response to a track being expanded.

We could introduce some flag into the API to note that a track "can be expanded" or "might be loaded later", that gives more information to the component to let it know that a track should present an expand button.

atkinchris avatar May 30 '19 12:05 atkinchris