-
-
Couldn't load subscription status.
- Fork 1.4k
Description
Description
Even the ESM version of Apex Charts leaks two globals to the global scope: addResizeListener() and removeResizeListener().
These seem to originate here: https://github.com/apexcharts/apexcharts.js/blob/e9e7fefc7fcd5d94b6ad23eda3e19da07d250a83/src/utils/DetectElementResize.js
Furthermore, the very same script causes errors when Apex Charts is used in Shadow DOM.
I'd suggest ditching this altogether and using ResizeObserver with a polyfill for older browsers (it's already supported natively for 92% of users).
Reproduction Link
https://codepen.io/leaverou/pen/rNzYdXj?editors=0010
but literally any snippet would demonstrate the issuse.
In this pen I'm also logging the globals though.