Skip to content

bug: no level one heading in apps #23746

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

Closed
3 tasks done
darrylnoakes opened this issue Aug 9, 2021 · 7 comments
Closed
3 tasks done

bug: no level one heading in apps #23746

darrylnoakes opened this issue Aug 9, 2021 · 7 comments
Labels
a11y Accessibility related issues package: core @ionic/core package type: bug a confirmed bug report

Comments

@darrylnoakes
Copy link

Prequisites

Describe the Feature Request

Make the internal element used by ion-title an h1 when used in a page header.
This improves accessibility.

Describe the Use Case

This greatly improves accessibility.
There are many more small changes like this that could be made throughout the framework...

Describe Preferred Solution

ion-title currently always uses a div. An actual header element could be used instead.

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 9, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. Is there a particular issue you are running into with the way ion-title is structured right now? ion-title can be used for more than just top level headings, so I think forcing it to use h1 will cause additional accessibility issues.

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Aug 9, 2021
@ionitron-bot ionitron-bot bot removed the triage label Aug 9, 2021
@darrylnoakes
Copy link
Author

I did state that it should be "when used in a page header", but maybe I didn't make my request clear enough.
I was wondering if the the ion-title could detect if it was naming a page (i.e. in a page header), and use an h1 instead of a div only then.

I understand if this would be too complex. If that is the case, please say so, and I will (try to) forget about it.

Alternative, rather hacky solution I think should work for most cases: just put an h* into the slot.
<ion-title><h1>Title of the Page</h1></ion-title>

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Aug 9, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the clarification. I worry that adding this logic into ion-title would rely on it having to make (possibly incorrect) assumptions about how a dev's app is laid out.

Are you running into a particular accessibility issue/warning?

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Aug 9, 2021
@ionitron-bot ionitron-bot bot removed the triage label Aug 9, 2021
@darrylnoakes
Copy link
Author

Currently, axe DevTools gives a warning that the page has no level-one heading, and Windows Narrator (I have not tried other screen readers yet) does not read the title out.

It reads the back button I have in the toolbar, and then reads the content of the page.

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Aug 9, 2021
@liamdebeasi liamdebeasi changed the title feat: make ion-title use an h1 bug: no level one heading in apps Aug 9, 2021
@liamdebeasi
Copy link
Contributor

Thanks. I think this is something Ionic should handle/make easier. One idea is to keep the scope extremely limited and just have it render an h1 if it is used inside of ion-header.

@liamdebeasi liamdebeasi added a11y Accessibility related issues package: core @ionic/core package type: bug a confirmed bug report labels Aug 9, 2021
@ionitron-bot ionitron-bot bot removed triage labels Aug 9, 2021
@liamdebeasi liamdebeasi added type: bug a confirmed bug report and removed type: bug a confirmed bug report labels Dec 15, 2023
@liamdebeasi
Copy link
Contributor

Thanks for the issue. After making a proof of concept and discussing this with the team we have decided to add documentation to inform devs on how to add proper headings in their applications.

We found that trying to automatically account for this in Ionic resulted in very brittle code because ion-title can be use in multiple ways (including using multiple titles within a single header).

The docs are live, so I am going to close this. Let me know if you have any questions.

Copy link

ionitron-bot bot commented May 9, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y Accessibility related issues package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants