From ad758cf193733cc682aa85cb26b1d6e2401e4826 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 17 Jan 2022 13:07:51 +0530 Subject: [PATCH 1/4] slash in input box handled --- .../src/lib/solidity-unit-testing.tsx | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 2acb1ee4e4..c8952801f8 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -167,15 +167,7 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d const handleTestDirInput = async (e: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any let testDirInput = trimTestDirInput(e.target.value) testDirInput = helper.removeMultipleSlashes(testDirInput) - if (testDirInput !== '/') testDirInput = helper.removeTrailingSlashes(testDirInput) setInputPathValue(testDirInput) - if (e.key === 'Enter') { - if (await testTabLogic.pathExists(testDirInput)) { - testTabLogic.setCurrentPath(testDirInput) - await updateForNewCurrent() - return - } - } if (testDirInput) { if (testDirInput.endsWith('/') && testDirInput !== '/') { testDirInput = helper.removeTrailingSlashes(testDirInput) @@ -205,17 +197,6 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d } } - const handleEnter = async (e: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any - let inputPath = e.target.value - inputPath = helper.removeMultipleSlashes(trimTestDirInput(inputPath)) - setInputPathValue(inputPath) - if (disableCreateButton) { - if (await testTabLogic.pathExists(inputPath)) { - await setCurrentPath(inputPath) - } - } - } - const handleCreateFolder = async () => { let inputPath = trimTestDirInput(inputPathValue) let path = helper.removeMultipleSlashes(inputPath) @@ -674,8 +655,7 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d title="Press 'Enter' to change the path for test files." style={{ backgroundImage: "var(--primary)" }} onKeyDown={() => { if (inputPathValue === '/') setInputPathValue('')} } - onKeyUp={handleTestDirInput} - onChange={handleEnter} + onChange={handleTestDirInput} onClick = {() => { if (inputPathValue === '/') setInputPathValue('')} } />