diff --git a/packages/docregistry/src/default.ts b/packages/docregistry/src/default.ts index cdff7387370b..81d8a62ae627 100644 --- a/packages/docregistry/src/default.ts +++ b/packages/docregistry/src/default.ts @@ -417,15 +417,17 @@ abstract class ABCWidgetFactory extends MainAreaWidget implements IDocumentWidget { constructor(options: DocumentWidget.IOptions) { + + // Include the context ready promise in the widget ready promise + options.ready = Promise.all([options.ready, options.context.ready]).then( () => { return; }); super(options); + this.context = options.context; this.context.pathChanged.connect(this._onPathChanged, this); this._onPathChanged(); } - // TODO: redefine the populated/isPopulated to *also* wait for the context load/rendering - /** * Handle a path change. */