apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.35k stars 1.3k forks source link

ShadowDOM broken in 3.33.2 #3040

Open tao-cumplido opened 2 years ago

tao-cumplido commented 2 years ago

Description

The ShadowDOM support added by @LeaVerou is broken in version 3.33.2. The cause is the call to getBoundingClientRect introduced in this commit https://github.com/apexcharts/apexcharts.js/commit/cf0d2cf98fe544ced23d4cb4a03fc3294cccd8a7, which fails when el is a document fragment node.

Steps to Reproduce

  1. Create an ApexCharts instance with an element inside a ShadowDOM, e.g. of a custom web component.

Expected Behavior

No error I guess

Actual Behavior

Uncaught (in promise) TypeError: t.getBoundingClientRect is not a function

Reproduction Link

https://codepen.io/leaverou/pen/WNEXzBe

JTarball commented 2 years ago

Still broken in 3.35.0