diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
index d274737c1f..0e3918ed6a 100644
--- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
+++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
@@ -81,6 +81,7 @@ class ContractDropdownUI {
enableContractNames (enable) {
if (enable) {
+ if (this.selectContractNames.value === '') return
this.selectContractNames.removeAttribute('disabled')
this.selectContractNames.setAttribute('title', 'Select contract for Deploy or At Address.')
} else {
@@ -113,8 +114,10 @@ class ContractDropdownUI {
this.atAddress = yo``
this.atAddressButtonInput = yo``
this.selectContractNames = yo``
+ this.abiLabel = yo`ABI file selected`
if (this.exEnvironment === 'vm') this.networkName = 'VM'
this.enableAtAddress(false)
+ this.abiLabel.style.display = 'none'
const savedConfig = window.localStorage.getItem(`ipfs/${this.exEnvironment}/${this.networkName}`)
this.ipfsCheckedState = savedConfig === 'true' ? true : false // eslint-disable-line
@@ -151,6 +154,7 @@ class ContractDropdownUI {
${this.selectContractNames} ${this.compFails}
+ ${this.abiLabel}
${this.createPanel}
@@ -191,8 +195,9 @@ class ContractDropdownUI {
this.compFails.style.display = 'none'
this.loadType = 'abi'
this.contractNamesContainer.style.display = 'block'
- this.selectContractNames.innerHTML = ''
- this.selectContractNames.appendChild(yo``)
+ this.abiLabel.style.display = 'block'
+ this.abiLabel.innerHTML = currentFile
+ this.selectContractNames.style.display = 'none'
this.enableContractNames(true)
this.enableAtAddress(true)
} else if (/.(.sol)$/.exec(currentFile)) {
@@ -200,17 +205,16 @@ class ContractDropdownUI {
this.orLabel.style.display = 'block'
this.contractNamesContainer.style.display = 'block'
this.loadType = 'sol'
- this.selectContractNames.innerHTML = ''
- this.enableContractNames(false)
- this.enableAtAddress(false)
+ this.selectContractNames.style.display = 'block'
+ this.abiLabel.style.display = 'none'
+ if (this.selectContractNames.value === '') this.enableAtAddress(false)
} else {
this.loadType = 'other'
this.createPanel.style.display = 'none'
this.orLabel.style.display = 'none'
this.compFails.style.display = 'none'
this.contractNamesContainer.style.display = 'none'
- this.enableContractNames(false)
- this.enableAtAddress(false)
+ this.abiLabel.style.display = 'none'
}
}