mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
* fix search on notebooks * keep focus on findwidget
This commit is contained in:
@@ -337,15 +337,15 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
|
||||
}
|
||||
|
||||
private _onFindInputKeyDown(e: IKeyboardEvent): void {
|
||||
|
||||
// focus on findWidget after navigating to result to prevent manually selecting the findInput to go to the next result
|
||||
if (e.equals(KeyCode.Enter)) {
|
||||
this._notebookController.getAction(ACTION_IDS.FIND_NEXT).run().then(null, onUnexpectedError);
|
||||
this._notebookController.getAction(ACTION_IDS.FIND_NEXT).run().then(null, onUnexpectedError).finally(() => this._findInput.focus());
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// focus on findWidget after navigating to result to prevent manually selecting findInput to go to the previous result
|
||||
if (e.equals(KeyMod.Shift | KeyCode.Enter)) {
|
||||
this._notebookController.getAction(ACTION_IDS.FIND_PREVIOUS).run().then(null, onUnexpectedError);
|
||||
this._notebookController.getAction(ACTION_IDS.FIND_PREVIOUS).run().then(null, onUnexpectedError).finally(() => this._findInput.focus());
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,10 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
// For Escape - the focused element is the div.notebook-preview or textarea.inputarea of the cell, so we need to make sure that it is a descendant of the current active cell
|
||||
// on the current active editor.
|
||||
const activeCellElement = this.container.nativeElement.querySelector(`.editor-group-container.active .notebook-cell.active`);
|
||||
const findWidgetVisible = !!document.querySelector(`.editor-widget.find-widget.visible`);
|
||||
let handled = false;
|
||||
// check that the find widget is not opened before handling notebook cell events
|
||||
if (!findWidgetVisible) {
|
||||
if (DOM.isAncestor(this.container.nativeElement, document.activeElement) && this.isActive() && this.model.activeCell) {
|
||||
const event = new StandardKeyboardEvent(e);
|
||||
if (!this.model.activeCell?.isEditMode) {
|
||||
@@ -185,7 +188,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
if (handled) {
|
||||
DOM.EventHelper.stop(e);
|
||||
}
|
||||
|
||||
}
|
||||
}));
|
||||
this._register(this.themeService.onDidColorThemeChange(this.updateTheme, this));
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
|
||||
Reference in New Issue
Block a user