a11yproject.com
a11yproject.com copied to clipboard
[Post] HOWTO: Ajax with ARIA-LIVE
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
- [X] I have read, and agree to follow this project's Contributing Guidelines
- [X] I have read, and agree to follow this project's Content Style Guide
- [X] I have read, and agree to follow this project's Code of Conduct
Sounds great! Looking forward to it 🎉
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)
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.