Apexcharts.js: destroy doesn't remove style: min-height from parent div

Created on 3 Jun 2020  路  7Comments  路  Source: apexcharts/apexcharts.js

version 3.19.2:
after calling destroy on a chart the parent div is empty as expected, but still has
an inline style="min-height: px;", and thus still occupies space on the page.

the desired outcome would be that destroy gets rid of all traces of the chart. (example use case: multiple synced charts where only some should be shown b/c of size constraints)

Most helpful comment

Released v3.20.0

All 7 comments

Fixed

Thanks for fixing the initial bug, but this has unfortunately introduced another one for us. Going from 3.19.2 to 3.19.3.
Just as vue-apexcharts ISSUE#256 writes it.

I think perhaps a check like this in Destroy.js:50 (clearDomElements()) could solve it:

if (this.w.globals.dom.Paper.node.parentNode && this.w.globals.dom.Paper.node.parentNode.parentNode) {
  this.w.globals.dom.Paper.node.parentNode.parentNode.style.minHeight =
      'unset'
}

Or even tidier with optional chaining:

if (this.w.globals.dom.Paper.node.parentNode?.parentNode) {
  this.w.globals.dom.Paper.node.parentNode.parentNode.style.minHeight =
      'unset'
}

@Knogobert Thanks for reporting, fixed it!

@junedchhipa When can we expect a new release with the issue reported by @Knogobert fixed? :)

@PhilippMeissner In 3-5 days

I don't want to stress, but any news @junedchhipa ? 馃槃

Released v3.20.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlil picture jlil  路  3Comments

ismaildervisoglu picture ismaildervisoglu  路  3Comments

tcarlsen picture tcarlsen  路  3Comments

maasha picture maasha  路  3Comments

georgehardy picture georgehardy  路  3Comments