tabs: detach hidden tabs from the DOM (reduces lag caused by heavy tabs)

This commit is contained in:
bordun 2022-05-02 19:31:36 +02:00
parent 4bcd53e97c
commit 9388ad3d36
2 changed files with 7 additions and 0 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## 1.16.2
- widgets
- tabs: detach hidden tabs from the DOM (reduces lag caused by heavy tabs)
## 1.16.1
- bug fixes

View file

@ -59,6 +59,7 @@ class Tab extends Panel {
hide() {
if (this.detached) return
this.container.classList.remove('show')
this.container.removeChild(this.widget)
this.detached = true
this.setVisibility()
}
@ -66,6 +67,7 @@ class Tab extends Panel {
show() {
if (!this.detached) return
this.container.classList.add('show')
this.container.appendChild(this.widget)
this.detached = false
this.setVisibility()
resize.check(this.widget, true)