Skip to content
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

♿ [#1608] Setting up focus trap for accordion and mobile menu #708

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/open_inwoner/js/components/questionnaire/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const stepIndicator = document.querySelector(

if (stepIndicator && question) {
/*
* Focus on the question only if it's the not the first one and if it's accessed via a mobile phone
* Focus on the question only if it's not the first one and if it's accessed via a mobile phone
*/
if (window.innerWidth < 768 && stepIndicator.dataset.step > 1) {
question.scrollIntoView()
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/js/components/toggle/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const BLOCK_TOGGLE = 'toggle'
const TOGGLES = BEM.getBEMNodes(BLOCK_TOGGLE)

/**
* Class for generic toggles.
* Class for generic toggles (like FAQ accordion).
*
* Toggle should have BLOCK_TOGGLE present in classList for detection.
* Toggle should have data-toggle-target set to query selector for target.
Expand Down
1 change: 1 addition & 0 deletions src/open_inwoner/scss/components/Faq/_Faq.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
}

&__answer:not(#{&}__answer--open) {
display: none;
opacity: 0;
height: 0;
transition: all 0.3s, height 0s, opacity 0.01s;
Expand Down
6 changes: 6 additions & 0 deletions src/open_inwoner/scss/views/_body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
overflow: hidden;
position: fixed;

// Hide focus for accessibility
.container,
.footer {
display: none;
}

@media (min-width: 768px) {
height: auto;
overflow: auto;
Expand Down