From 496b02bdd25bc898d026c5e9ac033a2b42896456 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 14 Jul 2019 22:48:39 -0400 Subject: [PATCH] [frio] Accessibility: enable keyboard action on visibility panels in compose page --- view/templates/item/compose-footer.tpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/view/templates/item/compose-footer.tpl b/view/templates/item/compose-footer.tpl index dc55cd9e4e..697be6fd10 100644 --- a/view/templates/item/compose-footer.tpl +++ b/view/templates/item/compose-footer.tpl @@ -45,6 +45,14 @@ e.stopPropagation() } }); + // Accessibility: enable space and enter to open a panel when focused + $('body').on('keyup', '[data-toggle="collapse"]:focus', function (e) { + if (e.key === ' ' || e.key === 'Enter') { + $(this).click(); + e.preventDefault(); + e.stopPropagation(); + } + }); $('#visibility-public-panel').on('show.bs.collapse', function() { $('#visibility-public').prop('checked', true);