diff --git a/apps/remix-ide/src/app/ui/modal-dialog-custom.js b/apps/remix-ide/src/app/ui/modal-dialog-custom.js index ec4535ecc6..a0cf78bdbb 100644 --- a/apps/remix-ide/src/app/ui/modal-dialog-custom.js +++ b/apps/remix-ide/src/app/ui/modal-dialog-custom.js @@ -67,7 +67,25 @@ module.exports = { function prompt (title, text, hidden, inputValue, ok, cancel, focus) { if (!inputValue) inputValue = '' var type = hidden ? 'password' : 'text' - var input = yo`` + var input = yo` + + ` + const validateInput = (e) => { + if (e.target.value === '') { + document.getElementById('modal-footer-ok').classList.add('disabled') + } else { + document.getElementById('modal-footer-ok').classList.remove('disabled') + } + } + modal(title, yo`
${text}
${input}
`, { fn: () => { if (typeof ok === 'function') ok(document.getElementById('prompt_text').value) } diff --git a/apps/remix-ide/src/app/ui/modaldialog.js b/apps/remix-ide/src/app/ui/modaldialog.js index a72b4a0941..90d938323a 100644 --- a/apps/remix-ide/src/app/ui/modaldialog.js +++ b/apps/remix-ide/src/app/ui/modaldialog.js @@ -130,7 +130,7 @@ module.exports = (title, content, ok, cancel, focusSelector, opts) => { function html (opts) { return yo` -