Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/applet-view/src/avoutputarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ export class AppletViewOutputArea extends AccordionPanel {
}
const app = this.widgets[appIndex] as Panel;
const clone = this.cloneCell(cell, cellid);
clone.node.addEventListener('contextmenu', e => {
e.preventDefault();
});
this.addToObserver(appIndex, clone);
app.addWidget(clone);

Expand Down
10 changes: 7 additions & 3 deletions packages/interceptor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ export class AppletWidgetRegistry implements IAppletWidgetRegistry {
}
}

getModelId(path: string) {
getModelId(path: string): string | undefined {
return this._pathToModelId[path];
}

getModel(path: string) {
getModel(path: string): WidgetModel | undefined {
return this._pathToModel[path];
}

getPath(modelId: string) {
getPath(modelId: string): string | undefined {
return this._modelIdToPath[modelId];
}

Expand Down Expand Up @@ -169,6 +169,10 @@ function activateWidgetInterceptor(
) => {
// const modelId = wRegistry.getModelId(args.path);
const model = wRegistry.getModel(args.path);
if (!model) {
// just skip
return;
}
const state = await (
model.constructor as typeof WidgetModel
)._deserialize_state(args.state, model.widget_manager);
Expand Down