Created
July 19, 2022 21:23
-
-
Save dislokacia/b44790c16fadbeec161238180fb19eb6 to your computer and use it in GitHub Desktop.
Accessible jet-pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function( $ ){ | |
init(); | |
$( document ).on( 'jet-filter-content-rendered', function() { | |
setTimeout(function() { | |
init(); | |
$('.jet-filters-pagination__current .jet-filters-pagination__link').attr('aria-pressed', 'true'); | |
}, 1); | |
}); | |
function init(){ | |
$('.jet-filters-pagination__link').each(function(){ | |
$(this).attr('role', 'button'); | |
$(this).attr('aria-pressed', 'false'); | |
$(this).attr('tabindex', '0'); | |
}); | |
$(".jet-filters-pagination__link").on('keypress',function(e) { | |
if(e.which === 13 || e.which === " " || e.which === "Spacebar" ) { | |
$(this).trigger('click'); | |
}; | |
}); | |
}; | |
}); |
Have you created anything for the JetSmartFilters checkbox, radio, range, and visual filters? They are not accessible out of the box. Crocoblock just pointed me to this code snippet, which doesn't resolve the issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The idea was taken from here