Skip to content

Commit

Permalink
fix notebook editor focusing (#14229)
Browse files Browse the repository at this point in the history
* fix notebook editor focusing

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

* added tabindex to loading editor

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>

---------

Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
  • Loading branch information
jonah-iden authored Sep 30, 2024
1 parent 6d395f8 commit 1f5eb2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/notebook/src/browser/notebook-editor-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class NotebookEditorWidget extends ReactWidget implements Navigatable, Sa

protected override onActivateRequest(msg: Message): void {
super.onActivateRequest(msg);
this.node.focus();
(this.node.getElementsByClassName('theia-notebook-main-container')[0] as HTMLDivElement)?.focus();
}

getResourceUri(): URI | undefined {
Expand Down Expand Up @@ -271,7 +271,7 @@ export class NotebookEditorWidget extends ReactWidget implements Navigatable, Sa
</div>
</div>;
} else {
return <div className='theia-notebook-main-container'>
return <div className='theia-notebook-main-container' tabIndex={-1}>
<div className='theia-notebook-main-loading-indicator'></div>
</div>;
}
Expand Down

0 comments on commit 1f5eb2b

Please # to comment.