Paginator: destroy view before removing it

This commit is contained in:
John Factotum
2024-03-23 12:12:39 +08:00
parent 18159a4d07
commit b0d7ed481f
+4 -1
View File
@@ -533,7 +533,10 @@ export class Paginator extends HTMLElement {
this.sections = book.sections
}
#createView() {
if (this.#view) this.#container.removeChild(this.#view.element)
if (this.#view) {
this.#view.destroy()
this.#container.removeChild(this.#view.element)
}
this.#view = new View({
container: this,
onExpand: () => this.scrollToAnchor(this.#anchor),