mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
Fixed bug: Execute cell should scroll to its results (#5861)
This commit is contained in:
@@ -43,7 +43,7 @@ export class OutputComponent extends AngularDisposable implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.renderOutput();
|
||||
this.renderOutput(true);
|
||||
this._initialized = true;
|
||||
this._register(Event.debounce(this.cellModel.notebookModel.layoutChanged, (l, e) => e, 50, /*leading=*/false)
|
||||
(() => this.renderOutput()));
|
||||
@@ -70,11 +70,21 @@ export class OutputComponent extends AngularDisposable implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private renderOutput() {
|
||||
private renderOutput(focusAndScroll: boolean = false): void {
|
||||
let options = outputProcessor.getBundleOptions({ value: this.cellOutput, trusted: this.trustedMode });
|
||||
options.themeService = this._themeService;
|
||||
// TODO handle safe/unsafe mapping
|
||||
this.createRenderedMimetype(options, this.outputElement.nativeElement);
|
||||
if (focusAndScroll) {
|
||||
this.setFocusAndScroll(this.outputElement.nativeElement);
|
||||
}
|
||||
}
|
||||
|
||||
private setFocusAndScroll(node: HTMLElement): void {
|
||||
if (node) {
|
||||
node.focus();
|
||||
node.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||
}
|
||||
}
|
||||
|
||||
public layout(): void {
|
||||
|
||||
Reference in New Issue
Block a user