Skip to content

Commit 836770d

Browse files
committed
redo fixes
1 parent fe28a1a commit 836770d

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
183183
// throw new Error('Method not implemented.');
184184
}
185185

186-
didFocusOutputInputChange(focus: boolean): void {
186+
didFocusOutputInputChange(inputFocused: boolean): void {
187187
// noop
188188
}
189189

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export interface INotebookDelegateForWebview {
9494
setScrollTop(scrollTop: number): void;
9595
triggerScroll(event: IMouseWheelEvent): void;
9696
updatePerformanceMetadata(cellId: string, executionId: string, duration: number, rendererId: string): void;
97-
didFocusOutputInputChange(focus: boolean): void;
97+
didFocusOutputInputChange(inputFocused: boolean): void;
9898
}
9999

100100
interface BacklayerWebviewOptions {
@@ -879,7 +879,7 @@ export class BackLayerWebView<T extends ICommonCellInfo> extends Themable {
879879
break;
880880
}
881881
case 'outputInputFocus': {
882-
this.notebookEditor.didFocusOutputInputChange(data.hasFocus);
882+
this.notebookEditor.didFocusOutputInputChange(data.inputFocused);
883883
}
884884
}
885885
}));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface IOutputBlurMessage extends BaseToWebviewMessage {
4949

5050
export interface IOutputInputFocusMessage extends BaseToWebviewMessage {
5151
readonly type: 'outputInputFocus';
52-
readonly hasFocus: boolean;
52+
readonly inputFocused: boolean;
5353
}
5454

5555
export interface IScrollToRevealMessage extends BaseToWebviewMessage {

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ async function webviewPreloads(ctx: PreloadContext) {
146146
}
147147

148148
if (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA') {
149-
postNotebookMessage<webviewMessages.IOutputInputFocusMessage>('outputInputFocus', { hasFocus: true });
149+
postNotebookMessage<webviewMessages.IOutputInputFocusMessage>('outputInputFocus', { inputFocused: true });
150150

151-
activeElement.addEventListener('onblur', () => {
152-
postNotebookMessage<webviewMessages.IOutputInputFocusMessage>('outputInputFocus', { hasFocus: false });
151+
activeElement.addEventListener('blur', () => {
152+
postNotebookMessage<webviewMessages.IOutputInputFocusMessage>('outputInputFocus', { inputFocused: false });
153153
}, { once: true });
154154
}
155155
};
@@ -159,8 +159,6 @@ async function webviewPreloads(ctx: PreloadContext) {
159159
return;
160160
}
161161

162-
checkOutputInputFocus();
163-
164162
for (const node of event.composedPath()) {
165163
if (node instanceof HTMLElement && node.classList.contains('output')) {
166164
// output
@@ -241,6 +239,7 @@ async function webviewPreloads(ctx: PreloadContext) {
241239
};
242240

243241
document.body.addEventListener('click', handleInnerClick);
242+
document.body.addEventListener('focusin', checkOutputInputFocus);
244243

245244
interface RendererContext extends rendererApi.RendererContext<unknown> {
246245
readonly onDidChangeSettings: Event<RenderOptions>;

0 commit comments

Comments
 (0)