react-bubble-chart icon indicating copy to clipboard operation
react-bubble-chart copied to clipboard

Prop Dependencies

Open aarondack opened this issue 8 years ago • 1 comments

Hey there!

I've been playing around with this bubble chart and noticed a discrepancy between the docs and what is actually happening. It lists some props as optional but in most cases they are required for the full functionality of the component.

For instance,

<ReactBubbleChart
   ....
   onClick={someFunc()}
   legend={false}
/>

Will result in that onClick handler never properly firing. Indeed it also appears that other props are dependent on this legend prop being set to true. I would expect onClick to happen regardless of whether or not the optional legend prop has been supplied.

Thoughts?

aarondack avatar Jan 20 '17 20:01 aarondack

I found the issue, the problem is that when the legend is false, its svg.bubble-legend ( empty ) element is placed on top of the chart and it catches all the pointer events that won't reach div.bubble-label elements that actually have the onClick handler.

The workaround I found is to disable the pointer events on the bubble-lengend: .bubble-legend { pointer-events: none; }

danilotorrisi avatar Aug 28 '17 07:08 danilotorrisi