Propagate onClick for TimelineDataDescription

Summary:
`onClick` was not getting called if it wasn't paired with `canSetCurrent`.

Ultimately, we can benefit from propagating this event in all cases as to give indication of whenever a marker has been selected.

Reviewed By: antonk52, aigoncharov

Differential Revision: D44628819

fbshipit-source-id: bee910b48ad065d7479e247fbacdcd738f281b26
This commit is contained in:
Lorenzo Blasa
2023-04-03 10:35:15 -07:00
committed by Facebook GitHub Bot
parent e4eecc53c4
commit f210ec809f

View File

@@ -72,7 +72,10 @@ export class TimelineDataDescription extends Component<Props, State> {
<div>
<MarkerTimeline
points={points}
onClick={(ids) => this.setState({selected: ids[0]})}
onClick={(ids) => {
this.setState({selected: ids[0]});
this.props.onClick?.(ids[0]);
}}
maxGap={50}
selected={this.state.selected}
/>