c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.34k stars 1.39k forks source link

Handles exception thrown by Firefox when calling getBBox within hidden element #2695

Closed panthony closed 5 years ago

panthony commented 5 years ago

Before I made the change in #2672 I was not aware that Firefox threw an exception if the DOM element is not rendered (ex: display: none;).

This PR wraps every calls made to getBBox and returns an empty box instead.

The method getBoundingClientRect was returning an object with all properties set to 0.

Can't really add a test for this since this is FF specific and we only have a chrome runner

Closes #2692