a11yproject.com icon indicating copy to clipboard operation
a11yproject.com copied to clipboard

[Post] HOWTO: Ajax with ARIA-LIVE

Open paulmcfe opened this issue 2 years ago • 3 comments

Thank you for your interest in writing a post! Please fill out the following information:

Your idea

A short(ish) article on setting up an element with ARIA-LIVE to alert ATs when the element gets content dynamically from an Ajax call.

Outline (optional)

How Assistive Technologies Handle Dynamic Content The Need for ARIA-LIVE Understanding the ARIA-LIVE Values Configuring ARIA Live Regions

Additional information (optional)

N/A

Terms

paulmcfe avatar Mar 22 '23 17:03 paulmcfe

Sounds great! Looking forward to it 🎉

ericwbailey avatar Mar 26 '23 17:03 ericwbailey

I'm having a lot of trouble with the tooling here. I've got the website running, I created a branch, and I'm able to commit a markdown file to src/posts. However, Eleventy has a problem with the file (error message below). Any idea what's wrong?

[Browsersync] Serving files from: ./dist/
[11ty] File added: src/posts/ajax-with-aria-live.md
[11ty] Unhandled rejection in promise: (more in DEBUG output)
[11ty] > Tried to use templateContent too early (./src/posts/ajax-with-aria-live.md)

`TemplateContentPrematureUseError` was thrown:
[11ty]     TemplateContentPrematureUseError: Tried to use templateContent too early (./src/posts/ajax-with-aria-live.md)
        at get templateContent [as templateContent] (/Users/paul/Documents/Writing/a11yproject.com/node_modules/@11ty/eleventy/src/Template.js:697:23)
        at Object.memberLookup (/Users/paul/Documents/Writing/a11yproject.com/node_modules/nunjucks/src/runtime.js:251:17)
        at eval (eval at _compile (/Users/paul/Documents/Writing/a11yproject.com/node_modules/nunjucks/src/environment.js:633:18), <anonymous>:62:59)
        at iterCallback (/Users/paul/Documents/Writing/a11yproject.com/node_modules/nunjucks/src/runtime.js:293:11)
        at next (/Users/paul/Documents/Writing/a11yproject.com/node_modules/nunjucks/src/lib.js:328:7)
        at eval (eval at _compile (/Users/paul/Documents/Writing/a11yproject.com/node_modules/nunjucks/src/environment.js:633:18), <anonymous>:66:1)
        at /Users/paul/Documents/Writing/a11yproject.com/node_modules/@11ty/eleventy-plugin-rss/.eleventy.js:28:7
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

paulmcfe avatar Mar 27 '23 21:03 paulmcfe

Thank you for reporting this.

This is odd. I am able to reproduce the issue in a Codespace by creating a new Markdown file in ./src/posts/, like what you are describing. I'll need some more time to investigate, but wanted to confirm your finding.

ericwbailey avatar Mar 28 '23 00:03 ericwbailey