Skip to content

Commit

Permalink
fix: tabindex should not be required
Browse files Browse the repository at this point in the history
  • Loading branch information
receter committed Oct 7, 2024
1 parent e8dc94a commit fd9e7d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utils/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export function filterKeyEsc(handler: (e: React.KeyboardEvent) => void) {

export function accessibleOnClick(
handler: (e: React.KeyboardEvent) => void,
tabIndex: number
tabIndex?: number
) {
return {
role: "button",
tabIndex: tabIndex || 0,
tabIndex: tabIndex ?? 0,
onKeyDown: filterKeyEnter(handler),
onClick: handler,
};
Expand Down

0 comments on commit fd9e7d7

Please sign in to comment.