Skip to content
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

feat: new optional parameter appMountAttrs #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdrienLemaire
Copy link

Allowing the user to set custom html attributes to the app mount div.

I added this to solve the axe accessibility issue All page content must be contained by landmarks, specifying that all top html elements must be landmark elements

<html lang="en">
    <head>
        <title>Hello</title>
    </head>
    <body>
        <header>This is the header</header>
        <nav>This is the nav</nav>
        <main>This is the main</main>
        <footer>This is the footer</footer>
    </body>
</html>

In our case with react and html-webpack-template, the structure becomes:

<html lang="en">
    <head>
        <title>Hello</title>
    </head>
    <body>
        <!-- add the aria-hidden="true" attribute for screen readers to ignore that element -->
        <div id="root" aria-hidden="true">
            <header>This is the header</header>
            <nav>This is the nav</nav>
            <main>This is the main</main>
            <footer>This is the footer</footer>
        </div>
    </body>
</html>

@AdrienLemaire
Copy link
Author

AdrienLemaire commented Sep 17, 2020

Well, setting aria-hidden="true" doesn't seem to fix my initial problem, since I'm getting a new one now: https://dequeuniversity.com/rules/axe/3.5/aria-hidden-focus?application=axeAPI

Asked a question on SO to figure out the proper way to handle these a11y issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant