What fresh hell is THIS now? - Patrick Lauke
[cameron.fawcett] Hey guys, I wanted to pick your brains on a problem I am having on my current project. It's a fairly large Angular 1.3.x project and we are animating the ng-view which is a child of the <main>
when routing. On route complete I am setting programmatic focus to the <main tabindex="-1" aria-labelledby="main-heading">
but the dynamic child view has not necessarily be rendered yet when I set programmatic focus.
The problem is it appears that the a11y tree from the dynamic content contained within the ng-view
has not been updated when the DOM is updated, for NVDA (in Firefox and Chrome). When attempting to read the content (one press of the down arrow) the virtual cursor skips all of the content within the <main>
and goes to the footer or it is dropped into the middle of the dynamic content that was loaded. If I try to navigate via landmarks or headings, it will say "No next heading" and I need to shift + H
for it to find the h1
and h2
that was loaded in dynamically. Also, inspecting the a11y tree using DOM Inspector or Inspect it doesn't appear to update dynamically and sort of lazy loads it, i.e., waits until I manually navigate to that part of the tree.
I've tried removing the animations and setting the programatic focus to various other elements. The only solution I got to work so far was wait with a timeout and ensure the view is loaded and then set focus to the <h1>
. But this is not good UX for sighted users and is hacky while using a setTimeout
to wait for the animation to finish.
This works as expected in JAWS and VoiceOver, meaning on view load I can navigate the dynamic content with the virtual cursor. Has anyone experienced a similar situation with NVDA in SPA?
@Heydon
I don’t assume folks don’t understand HTML. I see evidence of it every day of my life.
Like I said, each time I tried to discuss this CSS methodology the conversation switches to "people don't understand HTML". But CSS is much more difficult to grasp than HTML. Think for a minute how many people don’t get CSS compared to how many do not get HTML. Still, I don’t go around saying “HTML people are cute trying to write CSS”. See my point? I think it’s better to try to educate people than belittling them.
[heydon] > I don’t go around saying “HTML people are cute trying to write CSS”.
Neither do I?
@marcysutton
And you're arguing about a talk that happened two years ago?
Uh? How's that relevant to the discussion? I'm not "arguing about a talk", I'm discussing the pros and cons of a method presented in that video.
[heydon] > You just did in this thread where I tried to discuss your approach.
No I didn’t.
@MichielBijl
Splitting HTML and CSS into different professions is bit weird though.
Isn't what we do when we say people who write CSS "do not understand HTML"? I'm not the one assuming that one cannot do both well.
How is adding more code (classes) to your HTML better for performance?
Ha, this is a better discussion. I said performance among other things (maintenance is the most important one though), but in term of performance, the classes in the markup are not as bad as the bytes in your styles sheets. That's because styles sheets are blocking. Think of listing all possible type
values for input
(email,
text`, etc.) versus using a unique class for all those inputs.
I’ve heard it all before.
k, I won't waste everybody's time then. Bye!
[karlgroves] > Convince them to become an American company and they will
Not until they get sued
\@marcysutton\ is apparently a rabble rouser
right on!