From 4f2fc110455b419fb0c430639730becdb7ecc40c Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Wed, 2 Aug 2023 11:52:33 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20refactor(App.tsx):=20remove=20un?= =?UTF-8?q?used=20code=20related=20to=20preventing=20control+backspace=20e?= =?UTF-8?q?vent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code related to preventing the control+backspace event in the application was removed as it was no longer needed. --- src/frontend/src/App.tsx | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index bd65f18cb..6b0180720 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -122,37 +122,6 @@ export default function App() { }; - //Prevent the control+backspace event on the application - const onKeyDownRef = useRef(false); - useEffect(() => { - const handleKeyDownCapture = (event) => { - - if(event.key === "Backspace" && event.ctrlKey === true) { - event.preventDefault(); - event.stopPropagation(); - } - onKeyDownRef.current = true; - }; - - const handleKeyUpCapture = (event) => { - if (onKeyDownRef.current) { - if(event.key === "Backspace" && event.ctrlKey === true) { - event.preventDefault(); - event.stopPropagation(); - } - onKeyDownRef.current = false; - } - }; - - document.addEventListener('keydown', handleKeyDownCapture, true); - document.addEventListener('keyup', handleKeyUpCapture, true); - - return () => { - document.removeEventListener('keydown', handleKeyDownCapture, true); - document.removeEventListener('keyup', handleKeyUpCapture, true); - }; - }, []); - return ( //need parent component with width and height