react-timeseries-charts icon indicating copy to clipboard operation
react-timeseries-charts copied to clipboard

Feature: Allowing event propagation on chart click events

Open joshuaball opened this issue 6 years ago • 0 comments

Because event propagation was being killed on the click event of each chart, this was not allowing parent DOM elements to receive the click event. Clicks on the background layers (ChartContainer, ChartRow, etc) would bubble up fine, but we miss any click events from charts. This PR allows event propagation at the chart level, and the onBackgroundClick property of the ChartContainer still works as intended by scrutinizing the event target of the click event that bubbles up to it and triggering the onBackgroundClick property only when the event target does not come from a chart component.

NOTE: I mocked up a "playground" example for demonstration that will need to be stripped out.

joshuaball avatar Aug 16 '19 00:08 joshuaball