I'm open to a use-case here that isn't obvious to me, I'm not saying you're wrong. But I don't understand why I wouldn't use `display: none` for an offscreen element or a hidden dialog/overlay? Screenreaders do skip over `display: none`, right?
If I'm moving an element offscreen but not full-on hiding it, in my experience 99% of the time it's because I want it to be visually hidden but still show up for a screenreader. `inert` gives me the opposite behavior by default. I'm trying to think when I've ever wanted an element to be visually hidden from both sighted users and a screenreader, but also couldn't do that via normal CSS.
Again, open to learning more, but this still seems to me like an attribute that should be generally avoided. I can think of some use-cases; maybe I have something like a chart where there are a lot of focusable elements but where the experience is awful for keyboard or screenreaders and I want to basically declare bankruptcy and say, "no, I don't want it to work with those controls at all, it might as well not exist for those people."
fragment content that be moved to be visible but you don't want announced. Things like long form news articles where you might render the graphics with accompanying descriptions off screen (to save cycles) but as you scroll into view while reading you shift it to be visible.
Really its good for anything where you don't want the browser to "paint" but you want to have the content fully loaded without the user having any idea until you essentially want them to
If I'm moving an element offscreen but not full-on hiding it, in my experience 99% of the time it's because I want it to be visually hidden but still show up for a screenreader. `inert` gives me the opposite behavior by default. I'm trying to think when I've ever wanted an element to be visually hidden from both sighted users and a screenreader, but also couldn't do that via normal CSS.
Again, open to learning more, but this still seems to me like an attribute that should be generally avoided. I can think of some use-cases; maybe I have something like a chart where there are a lot of focusable elements but where the experience is awful for keyboard or screenreaders and I want to basically declare bankruptcy and say, "no, I don't want it to work with those controls at all, it might as well not exist for those people."
But those situations seem very rare to me.