Skip to content
Permalink
Browse files

fix(renderers): don't store a reference to last active element if it

will never be used.
  • Loading branch information
RomkeVdMeulen committed Jul 30, 2019
1 parent c5f4ad4 commit 12a892d38a01d5b07dc80b25cd569d9e2676cd1e
Showing with 6 additions and 2 deletions.
  1. +3 −1 src/renderers/native-dialog-renderer.ts
  2. +3 −1 src/renderers/ux-dialog-renderer.ts
@@ -63,7 +63,9 @@ export class NativeDialogRenderer implements Renderer {
}

private attach(dialogController: DialogController): void {
this.lastActiveElement = DOM.activeElement as HTMLElement;
if (dialogController.settings.restoreFocus) {
this.lastActiveElement = DOM.activeElement as HTMLElement;
}

const spacingWrapper = DOM.createElement('div'); // TODO: check if redundant
spacingWrapper.appendChild(this.anchor);
@@ -121,7 +121,9 @@ export class DialogRenderer implements Renderer {
}

private attach(dialogController: DialogController): void {
this.lastActiveElement = DOM.activeElement as HTMLElement;
if (dialogController.settings.restoreFocus) {
this.lastActiveElement = DOM.activeElement as HTMLElement;
}

const spacingWrapper = DOM.createElement('div'); // TODO: check if redundant
spacingWrapper.appendChild(this.anchor);

0 comments on commit 12a892d

Please sign in to comment.
You can’t perform that action at this time.