Skip to content

Commit 9381153

Browse files
committed
fix(ion-alert): remove aria-labelledby and aria-describedby due the usage of focus.
1 parent 1c22eeb commit 9381153

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

core/src/components/alert/alert.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -744,21 +744,13 @@ export class Alert implements ComponentInterface, OverlayInterface {
744744
}
745745

746746
render() {
747-
const { overlayIndex, header, subHeader, message, htmlAttributes } = this;
747+
const { overlayIndex, header, subHeader, htmlAttributes } = this;
748748
const mode = getIonMode(this);
749749
const hdrId = `alert-${overlayIndex}-hdr`;
750750
const msgId = `alert-${overlayIndex}-msg`;
751751
const subHdrId = `alert-${overlayIndex}-sub-hdr`;
752752
const role = this.inputs.length > 0 || this.buttons.length > 0 ? 'alertdialog' : 'alert';
753753

754-
/**
755-
* Use both the header and subHeader ids if they are defined.
756-
* If only the header is defined, use the header id.
757-
* If only the subHeader is defined, use the subHeader id.
758-
* If neither are defined, do not set aria-labelledby.
759-
*/
760-
const ariaLabelledBy = header && subHeader ? `${hdrId} ${subHdrId}` : header ? hdrId : subHeader ? subHdrId : null;
761-
762754
return (
763755
<Host
764756
tabindex="-1"
@@ -778,7 +770,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
778770

779771
<div tabindex="0" aria-hidden="true"></div>
780772

781-
<div class="alert-wrapper ion-overlay-wrapper" role={role} aria-modal="true" aria-labelledby={ariaLabelledBy} aria-describedby={message !== undefined ? msgId : null} tabindex="0" ref={(el) => (this.wrapperEl = el)} {...(htmlAttributes as any)}>
773+
<div class="alert-wrapper ion-overlay-wrapper" role={role} aria-modal="true" tabindex="0" ref={(el) => (this.wrapperEl = el)} {...(htmlAttributes as any)}>
782774
<div class="alert-head">
783775
{header && (
784776
<h2 id={hdrId} class="alert-title">

0 commit comments

Comments
 (0)