-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dialog] Consider using h* tag for the title element #3629
Comments
Just a note from me: before you over-engineer something around the usage of h*; go for an educated guess as e.g. above with dialogs of other design systems and use a h* by default inside the header. The rendering function allows people to overwrite the whole header anyway, which is probably used the most to add more content like close button so they have full access for the header anyway and can set the appropriate h* if needed. Edit: if login and confirm extends the dialog (flow side) the same would apply there as well. |
In addition to Material and Radix mentioned above to use The ARIA Practices Modal dialog example also uses The minutes of an ARIA Authoring Practices Group meeting discussing this dilemma doesn't reach a consensus, but one member is in favor of |
We've also discussed (elsewhere) to provide API for overriding the default heading level. I'm not sure if it's feasible to change the element's type to another |
In any case, based on the above I think H2 / aria-level="2" is a good default, whichever way it's implemented, and that we can postpone the implementation of the overriding API for a later version. Just need to implement the default now in a way that can be overridden later. (And yes, those other components that use or extend Dialog, they should at some point be refactored to use the new header and footer, and thus also whatever the new default heading level is, but that's of course outside the scope of this feature.) |
Over writing an attribute is probably easier than replacing an element; so this sounds good
Luckily the new header is already completely overwrite able if used without title set :) so it's fine for me as well |
As we now have a separate slot for the title element, it would make sense to use |
Totally agree! My concerns are gone now :) |
@rolfsmeds probably something interesting for the discussion here https://twitter.com/htmlstandard/status/1542725809848434688 |
The title property was introduced by #3623 and, when set, the Dialog creates an element to attach it to the
title
slot. Currently, it creates aspan
element.span
doesn't feel quite right for this purpose, so checking some component libraries, the ones found use<h2>
for the dialog title.Examples:
In the other hand, there's a similar discussion about the heading level on Confirm Dialog, and the use of a hard-coded h* tag was discourage here.
Originally posted by @DiegoCardoso in #3623 (comment)
The text was updated successfully, but these errors were encountered: