Skip to content

Commit

Permalink
Phosphor widget backward compatibility fix on WidgetRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Aug 21, 2024
1 parent c0c8eb8 commit e71feee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/base/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,11 @@ export class JupyterLuminoPanelWidget extends Panel {
private _view: DOMWidgetView;
}

/**
* @deprecated Use {@link JupyterLuminoPanelWidget} instead (Since 8.0).
*/
export const JupyterPhosphorPanelWidget = JupyterLuminoPanelWidget;

export class DOMWidgetView extends WidgetView {
/**
* Public constructor
Expand Down
3 changes: 2 additions & 1 deletion python/jupyterlab_widgets/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export class WidgetRenderer

let widget: LuminoWidget;
try {
widget = (await manager.create_view(wModel)).luminoWidget;
const view = await manager.create_view(wModel);
widget = view.luminoWidget || view.pWidget;
} catch (err) {
this.node.textContent = 'Error displaying widget';
this.addClass('jupyter-widgets');
Expand Down

0 comments on commit e71feee

Please sign in to comment.