|
@@ -245,7 +245,7 @@ export class Dialog<T> extends Widget {
|
|
|
this._primary = el as HTMLElement;
|
|
|
}
|
|
|
}
|
|
|
- this._primary.focus();
|
|
|
+ this._primary?.focus();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -388,7 +388,7 @@ export class Dialog<T> extends Widget {
|
|
|
const target = event.target as HTMLElement;
|
|
|
if (!this.node.contains(target as HTMLElement)) {
|
|
|
event.stopPropagation();
|
|
|
- this._buttonNodes[this._defaultButton].focus();
|
|
|
+ this._buttonNodes[this._defaultButton]?.focus();
|
|
|
}
|
|
|
}
|
|
|
|