Need help fixing a small issue
Hi,
while running react-charts inside a WebComponent (via https://www.npmjs.com/package/react-to-webcomponent), I ran into a small problem in Tooltip.tsx where the value passed into window.getComputedStyle() would ultimately become null and thus crashes the chart.
I was hoping to be able to quickly fix that, but in the process I noticed that I don't understand anything about this project :D The release specified on npm.js (2.0.0-beta7) is not listed in this GitHub repository (only 2.0.0-beta6 as a tag, but that seems to be the website). There are no releases for 2.0.0-beta* at all in the "Releases" tab on GitHub. Judging by the 2.0.0 release that does exist, it seems pretty old (2019) considering the npm package was released only 23 days ago.
Also, I don't know how to build a working version of this package. Checking out master and running npm i && npm run build produced outputs in the dist folder, but the filenames are different to the version distributed on npmjs and loading that locally (via a reference to the git repo in my projects package.json) produces errors.
Could you please help me get started / understand how you built and published the current release on npmjs or fix the problem in Tooltip.tsx for me? :)
I guess my problem would be solved simply by extending the loop condition, but as outlined, I did not succeed in trying it out in a reasonable time unfortunately :(
while (container instanceof Element && container.parentElement && container !== document.body) {
container = container.parentElement
const { overflowX, overflowY } = window.getComputedStyle(container)
Edit: Fixed obvious mistake in proposed fix (parentElement of container is accessed). Verified fix by hacking it into the release file published on npm 🤓