Skip to content

Commit

Permalink
fix: restore keyboard bindings for card buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSlug committed Aug 9, 2022
1 parent 97ca550 commit 85ab0c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/assets/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ https://github.com/fluid-project/handbook.floeproject.org/raw/main/LICENSE.md.

const menu = {};
const ARIA_EXPANDED = "aria-expanded";
const ENTER = 13;
const SPACE = 32;

$(document).ready(function () {
// Selectors for accordion container elements
Expand All @@ -34,6 +36,14 @@ $(document).ready(function () {
evt.preventDefault();
});
}

$(".card__toggle[role=button]").keydown(evt => {
var pressedKey = evt.keyCode || evt.which;
if (pressedKey === ENTER || pressedKey === SPACE) {
toggleAccordion(evt.delegateTarget, "card");
evt.preventDefault();
}
});
});

/**
Expand Down

0 comments on commit 85ab0c1

Please sign in to comment.