You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: ion-modal - aria-labelledby on the host does not reach the dialog element #31622
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
The documentation states that aria-labelledby can be set on ion-modal to name the dialog.
The role="dialog" element lives in the shadow root and only aria-label and role are
forwarded to it (inheritAriaAttributes / htmlAttributes); aria-labelledby set on the host
or via htmlAttributes stays on the host, which has no role, so the dialog is announced
without a name. Naming works only with a literal aria-label, which duplicates the visible
title and is not kept in sync with it.
Verified with the reproduction on Ionic 8.8.5 (Chrome 154, page "4 ion-modal aria-labelledby"): host aria-labelledby="modal-title", inner [role=dialog] has neither aria-labelledby nor aria-label.
Expected Behavior
The documentation states that aria-labelledby can be set on ion-modal to name the dialog.
The role="dialog" element lives in the shadow root and only aria-label and role are
forwarded to it (inheritAriaAttributes / htmlAttributes); aria-labelledby set on the host
or via htmlAttributes stays on the host, which has no role, so the dialog is announced
without a name. Naming works only with a literal aria-label, which duplicates the visible
title and is not kept in sync with it.
Verified with the reproduction on Ionic 8.8.5 (Chrome 154, page "4 ion-modal aria-labelledby"): host aria-labelledby="modal-title", inner [role=dialog] has neither aria-labelledby nor aria-label.
Activity