Skip to content

Commit

Permalink
[core] don't scroll when closing a dialog
Browse files Browse the repository at this point in the history
When a dialog gets closed, the previously
active element gets focus again. We don't
want the default scroll to top behavior.

Signed-off-by: Sven Efftinge <sven.efftinge@typefox.io>
  • Loading branch information
svenefftinge committed Dec 2, 2019
1 parent b76f08e commit 5d24847
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/browser/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export abstract class AbstractDialog<T> extends BaseWidget {
close(): void {
if (this.resolve) {
if (this.activeElement) {
this.activeElement.focus();
this.activeElement.focus({ preventScroll: true });
}
this.resolve(undefined);
}
Expand Down

0 comments on commit 5d24847

Please sign in to comment.