diff --git a/app/assets/javascripts/discourse/app/components/create-account.js b/app/assets/javascripts/discourse/app/components/create-account.js index 36ac076d183..745cd75ef38 100644 --- a/app/assets/javascripts/discourse/app/components/create-account.js +++ b/app/assets/javascripts/discourse/app/components/create-account.js @@ -6,19 +6,19 @@ export default Component.extend({ classNames: ["create-account-body"], userInputFocus(event) { - let label = event.target.parentElement.previousElementSibling; - if (!label.classList.contains("value-entered")) { - label.classList.toggle("value-entered"); + const controls = event.target.parentElement; + if (!controls.classList.contains("value-entered")) { + controls.classList.toggle("value-entered"); } }, userInputFocusOut(event) { - let label = event.target.parentElement.previousElementSibling; + const controls = event.target.parentElement; if ( event.target.value.length === 0 && - label.classList.contains("value-entered") + controls.classList.contains("value-entered") ) { - label.classList.toggle("value-entered"); + controls.classList.toggle("value-entered"); } }, diff --git a/app/assets/javascripts/discourse/app/templates/components/user-fields/text.hbs b/app/assets/javascripts/discourse/app/templates/components/user-fields/text.hbs index b504e8f15c5..2e851e186f3 100644 --- a/app/assets/javascripts/discourse/app/templates/components/user-fields/text.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/user-fields/text.hbs @@ -1,9 +1,9 @@ -