mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Paginator: destroy view before removing it
This commit is contained in:
+4
-1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user