File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,9 @@ export class AppletViewOutputArea extends AccordionPanel {
205205 }
206206 const app = this . widgets [ appIndex ] as Panel ;
207207 const clone = this . cloneCell ( cell , cellid ) ;
208+ clone . node . addEventListener ( 'contextmenu' , e => {
209+ e . preventDefault ( ) ;
210+ } ) ;
208211 this . addToObserver ( appIndex , clone ) ;
209212 app . addWidget ( clone ) ;
210213
Original file line number Diff line number Diff line change @@ -83,15 +83,15 @@ export class AppletWidgetRegistry implements IAppletWidgetRegistry {
8383 }
8484 }
8585
86- getModelId ( path : string ) {
86+ getModelId ( path : string ) : string | undefined {
8787 return this . _pathToModelId [ path ] ;
8888 }
8989
90- getModel ( path : string ) {
90+ getModel ( path : string ) : WidgetModel | undefined {
9191 return this . _pathToModel [ path ] ;
9292 }
9393
94- getPath ( modelId : string ) {
94+ getPath ( modelId : string ) : string | undefined {
9595 return this . _modelIdToPath [ modelId ] ;
9696 }
9797
@@ -169,6 +169,10 @@ function activateWidgetInterceptor(
169169 ) => {
170170 // const modelId = wRegistry.getModelId(args.path);
171171 const model = wRegistry . getModel ( args . path ) ;
172+ if ( ! model ) {
173+ // just skip
174+ return ;
175+ }
172176 const state = await (
173177 model . constructor as typeof WidgetModel
174178 ) . _deserialize_state ( args . state , model . widget_manager ) ;
You can’t perform that action at this time.
0 commit comments