Skip to content

Commit

Permalink
Merge pull request #1154 from City-of-Helsinki/UHF-10467-aria-fix
Browse files Browse the repository at this point in the history
UHF-10467 aria fix
  • Loading branch information
annadruid authored Jan 10, 2025
2 parents d3cc4c9 + d1c8392 commit 21249f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/js/closable-surveys.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/js/closable-surveys.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,16 @@ import LocalStorageManager from './localStorageManager';
function toggleOtherContentVisibility() {
const mainContent = document.querySelector('.dialog-off-canvas-main-canvas');
const cookieBanner = document.querySelector('.hds-cc__target');
const surveyContainer = document.getElementById('helfi-survey__container');

if (mainContent && !mainContent.hasAttribute('aria-hidden')) {
if (mainContent && !mainContent.hasAttribute('aria-hidden') && surveyContainer) {
mainContent.setAttribute('aria-hidden', 'true');
} else {
// eslint-disable-next-line no-unused-expressions
mainContent && mainContent.removeAttribute('aria-hidden');
}

if (cookieBanner && !cookieBanner.hasAttribute('aria-hidden')) {
if (cookieBanner && !cookieBanner.hasAttribute('aria-hidden') && surveyContainer) {
cookieBanner.setAttribute('aria-hidden', 'true');
} else {
// eslint-disable-next-line no-unused-expressions
Expand Down

0 comments on commit 21249f3

Please sign in to comment.