We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1909e03 commit 4d522b9Copy full SHA for 4d522b9
core/src/components/alert/alert.tsx
@@ -413,9 +413,13 @@ export class Alert implements ComponentInterface, OverlayInterface {
413
await this.delegateController.attachViewToDom();
414
415
await present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation).then(() => {
416
+ /**
417
+ * Check if alert has only one button and no inputs.
418
+ * If so, focus the button, oderwise focus the alert wrapper.
419
+ * This will map to the default native alert behavior.
420
+ */
421
if (this.buttons.length === 1 && this.inputs.length === 0) {
422
const queryBtn = this.wrapperEl?.querySelector('.alert-button') as HTMLButtonElement;
-
423
queryBtn.focus();
424
} else {
425
this.wrapperEl?.focus();
0 commit comments