Skip to content

Commit 0ec2a12

Browse files
committed
fix ipywidgets output bug involving using stable html without proper id and index set
1 parent e3c1bc7 commit 0ec2a12

File tree

1 file changed

+9
-1
lines changed
  • src/packages/frontend/jupyter/output-messages/mime-types

1 file changed

+9
-1
lines changed

src/packages/frontend/jupyter/output-messages/mime-types/html.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ const Html = ({
1313
index?: number;
1414
trust?: boolean;
1515
}) => {
16-
if (!trust || !requiresStableUnsafeHtml(value)) {
16+
// if id and index aren't set no way to track this as stable unsafe html.
17+
// This happens, e.g., right now with renderOutput with ipywidgets, which is probably OK, since usually
18+
// with widgets the HTML doesn't need to be stable -- you are using widgets for state, not HTML.
19+
if (
20+
id == null ||
21+
index == null ||
22+
!trust ||
23+
!requiresStableUnsafeHtml(value)
24+
) {
1725
return <HTML value={value} />;
1826
}
1927
return (

0 commit comments

Comments
 (0)