From 429bc8e6d2d5b3ac8c10d35870320ef8ae40153e Mon Sep 17 00:00:00 2001 From: gbrodman Date: Thu, 27 Feb 2020 13:20:10 -0500 Subject: [PATCH] Set focus correctly in lock modal (#499) --- .../google/registry/ui/js/registrar/registry_lock.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js b/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js index fae7daa26..f0326a114 100644 --- a/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js +++ b/core/src/main/javascript/google/registry/ui/js/registrar/registry_lock.js @@ -117,7 +117,11 @@ registry.registrar.RegistryLock.prototype.showModal_ = function(targetElement, d var modalElement = goog.soy.renderAsElement( registry.soy.registrar.registrylock.confirmModal, {domain: domain, isLock: isLock}); parentElement.prepend(modalElement); - goog.dom.getRequiredElement('domain-lock-password').focus(); + if (domain == null) { + goog.dom.getRequiredElement('domain-lock-input-value').focus(); + } else { + goog.dom.getRequiredElement('domain-lock-password').focus(); + } // delete the modal when the user clicks the cancel button goog.events.listen( goog.dom.getRequiredElement('domain-lock-cancel'),