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

Add attribute INERT in site for open modal dialog popup window #5

Open
korenevskiy opened this issue Nov 26, 2020 · 0 comments
Open

Comments

@korenevskiy
Copy link
Owner

korenevskiy commented Nov 26, 2020

  • Add attr INERT & aria-hidden="true"

https://web-standards.ru/articles/focus-and-inert/#section-13

<button onclick="showDialog()">
  Open my dialog!
</button>
<script>
  var myDialog = document.getElementById('my_dialog');
  var showDialog = function () {
    myDialog.showModal();
  }
  var closeDialog = function () {
    myDialog.close();
  }
</script>
<body>
    <div
        aria-labelledby="modal-title"
        class="c-modal"
        id="modal"
        role="dialog"
        tabindex="-1">
        <div role="document">
            <h2 id="modal-title">Save changes?</h2>
            <p>The changes you have made will be lost if you do not save them.<p>
            <button type="button">Save</button>
            <button type="button">Discard</button>
        </div>
    </div>
    <main inert>
        <!-- ... -->
    </main>
</body>
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

No branches or pull requests

1 participant