vakata/jstree

error on expand folder jstree 3.3.15

Closed this issue · 2 comments

on expanding a folder from the tree, sometimes this error occurs:
"Uncaught TypeError: can't access property "state", l[f.children[o]] is undefined"

image

" for (o in t = this._data.core.node.cloneNode(!0), c = 'jstree-node ', f.li_attr) f.li_attr.hasOwnProperty(o) && 'id' !== o && ('class' !== o ? t.setAttribute(o, f.li_attr[o]) : c += f.li_attr[o]);
for (f.a_attr.id || (f.a_attr.id = f.id + '_anchor'), t.childNodes[1].setAttribute('aria-selected', !!f.state.selected), t.childNodes[1].setAttribute('aria-level', f.parents.length), this.settings.core.compute_elements_positions && (t.childNodes[1].setAttribute('aria-setsize', l[f.parent].children.length), t.childNodes[1].setAttribute('aria-posinset', l[f.parent].children.indexOf(f.id) + 1)), f.state.disabled && t.childNodes[1].setAttribute('aria-disabled', !0), o = 0, h = f.children.length; o < h; o++) if (!l[f.children[o]].state.hidden) {
"

is is related somehow with the style file, if i delete the style file ..\jstree\themes\default\style.min.css the arrow vanishes but the double click to expand still works and, it seams to be working way better now, still happens but way less, if i return the .css the error starts again in 90% of the cases

the funny part is, locally i had to try 1000x to reproduce the error but in the server the error occurs 90% of time

vakata commented

This is likely due to IDs being inconsistent. That is the only reason for missing objects in the internal array. Check for duplicated IDs or missing IDs.