treant-js icon indicating copy to clipboard operation
treant-js copied to clipboard

Collapsible + Hide + AnimateOnInit

Open Shizen opened this issue 6 years ago • 0 comments

If you have a chart which defines in config

            animateOnInit: true,
            hideRootNode: true,
            node: {
                collapsable: true
            },

Treant.js will generate an error trying to install the expand/collapse handler. This will also cause the chart not to be rendered :).

Treant.js:236 Uncaught TypeError: Cannot read property 'classList' of undefined at Object.toggleClass (Treant.js:236) at TreeNode.toggleCollapse (Treant.js:1659) at Treant.js:514

This using the JSON chart pattern. I didn't test if this also occurs with the array assignment pattern. You can reproduce this by added hideRootNode: true to the "collapsable" example.

Shizen avatar Sep 03 '18 23:09 Shizen