Skip to content

Commit

Permalink
[#2625] Improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
jiromaykin committed Nov 5, 2024
1 parent 4784daa commit 2cfd57c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="header--mobile header__submenu">

<div class="header--mobile__close">
{% button icon="close" text=_("Sluiten") hide_text=True icon_outlined=True transparent=True extra_classes="close-mobilenav" id="closeMobileNav" %}
{% button icon="close" text=_("Sluiten") hide_text=True icon_outlined=True transparent=True id="closeMobileNav" %}
</div>

<nav class="primary-navigation primary-navigation--mobile" aria-label="Hoofd navigatie">
Expand Down
8 changes: 2 additions & 6 deletions src/open_inwoner/js/components/FilterBar/filterbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ export class FilterBar {
htmx.on('htmx:afterSwap', function (e) {
if (e.detail && e.detail.target.id === 'cases-content') {
const filterBars = document.querySelectorAll(FilterBar.selector)
if (filterBars.length === 0) {
console.error('No filter bars found on the page after swap.')
} else {
if (filterBars.length !== 0) {
filterBars.forEach((filterbar) => new FilterBar(filterbar))
}
}
Expand All @@ -94,9 +92,7 @@ htmx.on('htmx:afterSwap', function (e) {
// Initialize FilterBar on DOM load for the initial page load
document.addEventListener('DOMContentLoaded', () => {
const filterBars = document.querySelectorAll(FilterBar.selector)
if (filterBars.length === 0) {
console.error('No filter bars found on the page.')
} else {
if (filterBars.length !== 0) {
filterBars.forEach((filterbar) => new FilterBar(filterbar))
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function initFilterBar() {

let closeIcon = document.createElement('span')
closeIcon.classList.add('material-icons', 'close-icon')
closeIcon.setAttribute('aria-hidden', 'true')
closeIcon.setAttribute('aria-hidden', 'false') // Hiding element that gets focus is not allowed in accessibility
closeIcon.setAttribute('tabindex', '0') // Adding tabindex for keyboard focus
closeIcon.textContent = 'close'

Expand Down

0 comments on commit 2cfd57c

Please sign in to comment.