From 647c5a259560de402142cc0603217cdf8700fc8c Mon Sep 17 00:00:00 2001 From: Stephen Long Date: Thu, 27 Apr 2023 15:16:56 -0700 Subject: [PATCH] Prevent double sort from Enter key press In the current implementation, using the enter key triggers the sort change twice. Once due to using enter key on a button, which by default (in Chrome at least) triggers that button's onClick, and the second time due to the onKeyUp function. Space bar is currently the work around, but for keyboard only users (blind/low vision) this is broken behavior. --- src/components/TableHeadCell.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/components/TableHeadCell.js b/src/components/TableHeadCell.js index 8293dec3a..e3c8fb80d 100644 --- a/src/components/TableHeadCell.js +++ b/src/components/TableHeadCell.js @@ -91,14 +91,6 @@ const TableHeadCell = ({ const { classes } = useStyles(); - const handleKeyboardSortInput = e => { - if (e.key === 'Enter') { - toggleSort(index); - } - - return false; - }; - const handleSortClick = () => { toggleSort(index); }; @@ -215,7 +207,6 @@ const TableHeadCell = ({ }}>