From fea0cfd5c3020a68b6d77c04a01e71b77bb0e73e Mon Sep 17 00:00:00 2001 From: avidrucker Date: Mon, 6 Nov 2023 15:32:30 -0500 Subject: [PATCH] fix missing tabIndex, keyboard select on btn --- src/App.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 9b2e5af..338ad21 100644 --- a/src/App.js +++ b/src/App.js @@ -172,6 +172,17 @@ function App() { setErrMsg("Please select a valid JSON file."); } }; + + const handleLabelKeyPress = (event) => { + // Check for Enter or Space key + if (event.key === 'Enter' || event.key === ' ') { + // Prevent the default action to avoid scrolling on Space press + event.preventDefault(); + // Trigger click on file input + document.getElementById('file-upload').click(); + } + }; + return (
@@ -284,7 +295,11 @@ function App() {

Here you can import (load) and export (save) JSON lists.

-