hadnling aria-pressed for button filters

This commit is contained in:
Antoine M 2024-04-02 17:36:22 +02:00
parent 4893822053
commit 3357740c49

View File

@ -12,6 +12,7 @@ async function filterPosts(e) {
filterButtons.forEach((button) => { filterButtons.forEach((button) => {
button.classList.remove('filters-toolbar__action-button--active'); button.classList.remove('filters-toolbar__action-button--active');
button.setAttribute('aria-pressed', 'false');
}); });
const newsContainer = document.querySelector('.news-container .card-grid-container'); const newsContainer = document.querySelector('.news-container .card-grid-container');
@ -20,6 +21,7 @@ async function filterPosts(e) {
newsContainer.removeAttribute('isLoading'); newsContainer.removeAttribute('isLoading');
e.target.classList.add('filters-toolbar__action-button--active'); e.target.classList.add('filters-toolbar__action-button--active');
e.target.setAttribute('aria-pressed', 'true');
} }
async function hydrateNewsFeedByTypeId(filterID, termName) { async function hydrateNewsFeedByTypeId(filterID, termName) {