From c0fe370e598400235f686d418ec98a894320d31e Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Wed, 14 Jul 2021 18:24:56 +0200 Subject: [PATCH] Add ReactiveHTML remove script --- examples/user_guide/Custom_Components.ipynb | 1 + panel/models/reactive_html.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/user_guide/Custom_Components.ipynb b/examples/user_guide/Custom_Components.ipynb index a32e9f5ba4..bafa6828ff 100644 --- a/examples/user_guide/Custom_Components.ipynb +++ b/examples/user_guide/Custom_Components.ipynb @@ -219,6 +219,7 @@ "\n", "- `'render'`: This callback is invoked during initial rendering of the component.\n", "- `'after_layout'`: This callback is invoked after the component has been fully rendered and the layout is fully computed.\n", + "- `'remove'`: This callback is invoked when the component is removed.\n", "\n", "#### Explicit calls\n", "\n", diff --git a/panel/models/reactive_html.ts b/panel/models/reactive_html.ts index 928d5721a6..330e21a07e 100644 --- a/panel/models/reactive_html.ts +++ b/panel/models/reactive_html.ts @@ -202,6 +202,7 @@ export class ReactiveHTMLView extends PanelHTMLBoxView { super.disconnect_signals() this._remove_event_listeners() this._remove_mutation_observers() + this.run_script('remove', true) } get child_models(): LayoutDOM[] {