diff --git a/packages/applet-view/src/avoutputarea.ts b/packages/applet-view/src/avoutputarea.ts index 9ab19e6..e8cb3e9 100644 --- a/packages/applet-view/src/avoutputarea.ts +++ b/packages/applet-view/src/avoutputarea.ts @@ -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); diff --git a/packages/interceptor/src/index.ts b/packages/interceptor/src/index.ts index 71cf6e1..2360675 100644 --- a/packages/interceptor/src/index.ts +++ b/packages/interceptor/src/index.ts @@ -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]; } @@ -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);