diff --git a/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts b/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts index 146281e3a6f..be041c85c4f 100644 --- a/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts +++ b/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts @@ -132,6 +132,9 @@ export function useWebviewMount(webview: Promise) { return; } try { + // We're using the base ref here because it's a constant reference and thus + // will avoid unnecessary mismatches for claiming and releasing the webview + // across multiple renders. webviewElement.claim(containerRef, getWindow(containerRef.current), undefined); } catch (err) { setError(new WebviewMountError('Failed to claim webview', err instanceof Error ? err : undefined));