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

Why not have sub tree not-inert id specified? #50

Closed
Jab2870 opened this issue Mar 29, 2017 · 4 comments
Closed

Why not have sub tree not-inert id specified? #50

Jab2870 opened this issue Mar 29, 2017 · 4 comments

Comments

@Jab2870
Copy link

Jab2870 commented Mar 29, 2017

Why can we not set inert=false on an element under an inert element. Here is a simple example when this could be useful:

Full Screen Menu

If I had the follwing html

<body>
<main>
My Main content
There are focusable elements in here
<aside>
My sidebar
There are also focusable elements in here
</aside>
<nav>
This is a full screen menu with focusable links
</nav>
</body>

When the Full Screen Menu is activated, I would like everything except the menu to become inert. I know that in this simple example, setting inert on the main and the asside isn't that diffictult but it would be much easier to set inert=true on the body element then inert=false on the nav element.

@robdodson
Copy link
Collaborator

When we were first getting into inert we debated this specific topic for a long time. We came to the conclusion that it's better for inert to be consistent, otherwise you could never really trust it. For example, say you put inert on your <body> but elsewhere in the page you load an <iframe> for an ad and tucked in that ad is an inert=false. Developers don't often have fine grained control over the ads code that gets loaded into their site, so this scenario is very possible and would make inert kind of useless.

We proposed a separate primitive for the use case you're describing, tentatively called blockingElements. You can check out a polyfill here. Basically blockingElements lets you say "everyone except for me is inert", whereas inert lets you say "I am inert". Here's a write up I did to explain both in a bit more detail https://robdodson.me/building-better-accessibility-primitives/. Hope that helps!

@robdodson
Copy link
Collaborator

Gonna close this but happy to reopen for discussion if folks would like to keep the conversation going

@Jab2870
Copy link
Author

Jab2870 commented Apr 6, 2017

@robdodson , thanks for your responce. Sorry for my late reply. Would you consider doing an A11ycast on blockingElements?

@robdodson
Copy link
Collaborator

yep I've added it to my list of things I need to talk about :)

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

2 participants