Skip to content

Commit

Permalink
Add a keyboard listener to stackable fees card to improve accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamik10 committed Dec 7, 2023
1 parent 17b4caa commit cfe8235
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/apps/fee-list/stackable-fees/stackable-fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ const StackableFees: FC<StackableFeeProps & MaterialProps> = ({
const { amount = 0, creationDate = "", reasonMessage = "" } = feeData;
const stackSize = amountOfMaterialsWithDueDate - 1;
const listReservationClass = clsx(["list-reservation", "my-32"], {
"list-reservation--stacked": stackSize > 1
"list-reservation--stacked": stackSize > 0
});
return (
<button
type="button"
onClick={() => openDetailsModalClickEvent(faust)}
onKeyUp={(e) => {
if (e.key === "Enter" || e.key === "Space") {
openDetailsModalClickEvent(faust);
}
}}
className={listReservationClass}
>
{feeData && (
Expand Down

0 comments on commit cfe8235

Please sign in to comment.