-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Title and Screen Readers #90
Comments
Yeah, you'd have to move around your routes to get it working I think... |
Perhaps there could be two rendering paths? One that renders the title immediately, in a before model hook, or the like. This would be available to screen-readers. Another that renders as it does now, waiting for page load. Currently it renders a static title and a dynamic titles at the same time in a routes lifecycle. This makes sense if the title is based on a model, but the title could be rendered much earlier if it's static string. eg:
or maybe there are 2 helpers
I don't really like the idea of 2 different helpers though, but I think this clearly communicates my intention. |
Since this is a rendered helper, it's not really possible to have fine-grained control over the title in this way; I can expose a function that would set the title in the route. |
Not sure what you have in mind, but I'm excited! Let me know if there's anything I can do to help? |
Yes! Please write up your requirements so I can expose this properly. Please be as detailed as possible |
To meet this requirement I have been putting static strings in the // routes/application.js
beforeModel() {
document.title = 'My App'
}
// routes/about.js
beforeModel() {
document.title = 'About - My App' My hope is this addon can solve this use case ie the rendering of static titles much earlier. A title that relies on a model obviously can't be rendered in a beforeModel hook, and that's ok, that use case just can't be solved, but at least static titles would be accessible. |
@camskene super, thanks :) |
Can you describe this in more detail? Currently the title on view page source through fastboot of my app shows that only my page-titles from application.hbs are initially rendered. None of the child routes have promise awaiting models. |
I've noticed the title isn't updated until after the page loads.
When using a screen-reader this is problematic as the title is read before the page has finished loading. This initially gives an inaccurate description of the page.
If the title is static could it be set before the model?
The text was updated successfully, but these errors were encountered: