From ed34d6dcc47cce2440e5a1b6e8c151ff18af2b68 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 17 Feb 2020 10:18:28 +0100 Subject: [PATCH] 'description_html' can be modified. --- packages/controls/src/widget_description.ts | 5 +++++ tests/test_sanitizer.ipynb | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/controls/src/widget_description.ts b/packages/controls/src/widget_description.ts index 80ba961d157..7b468012ebb 100644 --- a/packages/controls/src/widget_description.ts +++ b/packages/controls/src/widget_description.ts @@ -54,6 +54,11 @@ export class DescriptionView extends DOMWidgetView { this.label.style.display = 'none'; this.listenTo(this.model, 'change:description', this.updateDescription); + this.listenTo( + this.model, + 'change:description_html', + this.updateDescription + ); this.listenTo(this.model, 'change:tabbable', this.updateTabindex); this.updateDescription(); this.updateTabindex(); diff --git a/tests/test_sanitizer.ipynb b/tests/test_sanitizer.ipynb index 06a035e8406..fac435fde82 100644 --- a/tests/test_sanitizer.ipynb +++ b/tests/test_sanitizer.ipynb @@ -61,7 +61,8 @@ "metadata": {}, "outputs": [], "source": [ - "Checkbox(description=\"okOK\", description_html=False)" + "c = Checkbox(description=\"okOK\")\n", + "c" ] }, { @@ -70,7 +71,7 @@ "metadata": {}, "outputs": [], "source": [ - "Checkbox(description=\"ok\", description_html = True)" + "c.description_html = True" ] }, { @@ -79,7 +80,7 @@ "metadata": {}, "outputs": [], "source": [ - "Label(\"\")" + "Checkbox(description=\"ok\", description_html = True)" ] }, { @@ -88,7 +89,7 @@ "metadata": {}, "outputs": [], "source": [ - "Label.__mro__, Text.__mro__" + "Label(\"OK\", description_html=True)" ] } ],