Details
Description
We faced an a11y issue while BITV examination (german wcag). On user profiles activity stream there are two buttons for every activity with a check mark and three dots. Every of those buttons misses a description or label.
We fixed it the bad way. The code below is inside a function waiting 2 seconds before called as these buttons are a lot and not rendered fast.
// einzelne Aktivität gelesen Knopf hat keine Beschreibung try { let elems = document.querySelectorAll("button.notification-event-read-button"); let index = 0, length = elems.length; for(; index < length; index++) { elems[index].setAttribute('aria-label', 'Aktivität dieses Artikels als gelesen markieren'); } } catch (e) { console.log('Im Aktivitätsverlauf keine Knöpfe gefunden, die Artikel als gelesen markieren') }; // Aktivitätshistorie eines einzelnen Artikels toggeln Knopf hat keine Beschreibung try { let elems = document.querySelectorAll("button.toggle-notification-event-details"); let index = 0, length = elems.length; for(; index < length; index++) { elems[index].setAttribute('aria-label', 'Aktivitätshistorie dieses Artikels ein- und ausblenden'); } } catch (e) { console.log('Im Aktivitätsverlauf keine Knöpfe gefunden, die die Aktivitätshistorie ein- und ausblenden') };
That doesn't fix it at all. Every time you use the button to load older activities at the bottom these new ones wouldn't get the aria-labels as our script will be executed only when a new page is loaded.