Skip to content

Commit f8e5f9e

Browse files
authored
[Candidate] Fix microsoft#151981. Avoid re-focus output when output already has focus (microsoft#154999)
Fix microsoft#151981. Avoid re-focus output when output already has focus. (microsoft#154991)
1 parent b7bf869 commit f8e5f9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ async function webviewPreloads(ctx: PreloadContext) {
400400
function focusFirstFocusableInCell(cellId: string) {
401401
const cellOutputContainer = document.getElementById(cellId);
402402
if (cellOutputContainer) {
403+
if (cellOutputContainer.contains(document.activeElement)) {
404+
return;
405+
}
406+
403407
const focusableElement = cellOutputContainer.querySelector('[tabindex="0"], [href], button, input, option, select, textarea') as HTMLElement | null;
404408
focusableElement?.focus();
405409
}

0 commit comments

Comments
 (0)