From f8177308a5911037e36a4a8d3c052af1141f3569 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 22 Mar 2021 21:47:47 +0530 Subject: [PATCH] keycode check removed --- apps/remix-ide/src/app/tabs/test-tab.js | 38 +++++++++---------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 57dde5121a..1a45defae4 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -549,22 +549,19 @@ module.exports = class TestTab extends ViewPlugin { return yo`Progress: ${ready} finished (of ${this.runningTestsNumber})` } - updateDirList (keycode = 'none') { - const presentOptions = this.uiPathList.querySelectorAll('option') - // Initial load - if (keycode === 'none') { - for (const o of presentOptions) o.remove() - this.testTabLogic.dirList('/').then((options) => { - options.forEach((path) => this.uiPathList.appendChild(yo``)) - }) - } else if (this.inputPath.value && this.inputPath.value.endsWith('/')) { - for (const o of presentOptions) o.remove() - this.testTabLogic.dirList(this.inputPath.value).then((options) => { - options.forEach((path) => this.uiPathList.appendChild(yo``)) - }) + updateDirList (path) { + for (const o of this.uiPathList.querySelectorAll('option')) o.remove() + this.testTabLogic.dirList(path).then((options) => { + options.forEach((path) => this.uiPathList.appendChild(yo``)) + }) + } + + handleTestDirInput () { + if (this.inputPath.value && this.inputPath.value.endsWith('/')) { + this.updateDirList(this.inputPath.value) } else { let matchFound = false - for (var option of presentOptions) { + for (const option of this.uiPathList.querySelectorAll('option')) { if (option.innerHTML.startsWith(this.inputPath.value)) matchFound = true } // If there is no matching folder in the workspace with entered text, enable Create button @@ -578,15 +575,6 @@ module.exports = class TestTab extends ViewPlugin { this.updateGenerateFileAction().disabled = false } } - - /* - It is not possible anymore to see folder from outside of the current workspace - if (this.inputPath.value) { - this.testTabLogic.dirList(this.inputPath.value).then((options) => { - options.forEach((path) => this.uiPathList.appendChild(yo``)) - }) - } - */ } render () { @@ -604,7 +592,7 @@ module.exports = class TestTab extends ViewPlugin { name="utPath" style="background-image: var(--primary);" onkeyup=${(e) => { - if (e.keyCode) this.updateDirList(e.keyCode) + if (e.keyCode) this.handleTestDirInput() }} onchange=${(e) => this.updateCurrentPath(e)}/>` @@ -630,7 +618,7 @@ module.exports = class TestTab extends ViewPlugin { ` - this.updateDirList() + this.updateDirList('/') this.testsExecutionStopped.hidden = true this.testsExecutionStoppedError.hidden = true this.resultStatistics = this.createResultLabel()