jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

Detached dom node can't be released

Open PH8919 opened this issue 3 years ago • 3 comments

Hi Recently, I used tabs of jquery ui and run the demo https://jqueryui.com/tabs/#manipulation. I found the DOM is detached from the document tree but it is still referred by the classesElementLookup afer I closed the tabs like reference stack below: [1] at Detached InternalNode@28601088 [8] at Detached HTMLLIElement@234047 [0] at jQuery.fn.init@318399 ui-state-focus at Object@318349 classesElementLookup at $..@313757 uiTabs at Object@329781 jQuery360058556434809620382 at HTMLDivElement@275389

When I open/close the tab frequently, there are mass of detached dom node increated. Also I found there is no method to destroy single tab.

PH8919 avatar Aug 26 '22 05:08 PH8919

Thanks for the report. Does the issue you describe exist when jQuery UI 1.12.1 is used or only with jQuery UI 1.13.0 or newer?

mgol avatar Aug 29 '22 13:08 mgol

Hi mgol, The issue exists in both 1.12.1 and 1.13.x. I scanned the code, the dom is attached into different class attributes under classesElementLookup during creating. But there isn't method to destroy single tab and remove the dom from the corresponding class attributes. Plz check it!

Thanks BR

PH8919 avatar Aug 30 '22 00:08 PH8919

Thanks for the info. Since the issue is already in 1.12, given limited team resources it's not likely to be fixed by the UI team; see the project status at https://blog.jqueryui.com/2021/10/jquery-maintainers-update-and-transition-jquery-ui-as-part-of-overall-modernization-efforts/. PRs are welcome if they're not too complex.

mgol avatar Aug 30 '22 14:08 mgol