- Issue created by @nvandijk
- 🇳🇱Netherlands nvandijk
I made a quick proof of concept to be able to override the aria-current for the language block. See https://git.drupalcode.org/issue/drupal-3530505/-/tree/3530505-aria-curr....
Also adding a patch for own use.
- 🇳🇱Netherlands nvandijk
Looking further into this we might need to revise the working of '#set_active_class' (as used in LanguageBlock.php). Maybe making this more of a feature request than a bug report.
This currently only supports a boolean value and also sets the attributes of the wrapping
- - which causes the aria-current to be applied on both the li and the a.
- 🇳🇿New Zealand quietone
If this problem was discovered on a version of Drupal that is not 11.x, add that information in the issue summary and leave the version at 11.x. In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies → . Also mentioned on the version → section of the list of issue fields documentation.
- 🇳🇱Netherlands makertimswis
Another way of implementing this could be by making use of the `#set_active_class`
Currently, it's only supporting TRUE / (default) FALSE, but by adding string support with 'page', (string) 'true', 'step', 'location', 'date' and 'time' the correct aria label could set based on the usageThis way the place of implementing is responsible for the context, API change is minimal (even backwards compatible possible) and responsibility at the implementer (where context is the highest)
I could make a work-in-progress patch if this is a preferred route to take