A11Y: Don't mark multiple form labels as applying to the same element (#13289)

A11Y: Don’t mark multiple form labels as applying to the same element (#13289)

Co-authored-by: Jordan Vidrine jordan@jordanvidrine.com

diff --git a/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs b/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
index 2e20650..f042b36 100644
--- a/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
+++ b/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
@@ -35,7 +35,7 @@
                   </label>
                 {{/if}}
                 {{input-tip validation=emailValidation id="account-email-validation"}}
-                <label class="more-info" for="new-account-email">{{i18n "user.email.instructions"}}</label>
+                <span class="more-info">{{i18n "user.email.instructions"}}</span>
               </div>
 
               <div class="input-group">
@@ -53,7 +53,7 @@
                 {{/if}}
 
                 {{input-tip validation=usernameValidation id="username-validation"}}
-                <label class="more-info" for="new-account-username">{{i18n "user.username.instructions"}}</label>
+                <span class="more-info">{{i18n "user.username.instructions"}}</span>
               </div>
 
               <div class="input-group">
@@ -74,7 +74,7 @@
                   {{/if}}
 
                   {{input-tip validation=nameValidation}}
-                  <label class="more-info" for="new-account-name">{{nameInstructions}}</label>
+                  <span class="more-info">{{nameInstructions}}</span>
                 {{/if}}
               </div>
 
@@ -101,7 +101,7 @@
                   </label>
 
                   {{input-tip validation=passwordValidation}}
-                  <label class="more-info" for="new-account-password">{{passwordInstructions}}</label>
+                  <span class="more-info">{{passwordInstructions}}</span>
                   <div class="caps-lock-warning {{unless capsLockOn " hidden"}}">
                     {{d-icon "exclamation-triangle"}} {{i18n "login.caps_lock_warning"}}
                   </div>
@@ -118,7 +118,7 @@
                 <div class="input-group">
                   {{input value=inviteCode class=(value-entered inviteCode) id="inviteCode"}}
                   <label class="alt-placeholder" for="invite-code">{{i18n "user.invite_code.title"}}</label>
-                  <label class="more-info" for="invite-code">{{i18n "user.invite_code.instructions"}}</label>
+                  <span class="more-info">{{i18n "user.invite_code.instructions"}}</span>
                 </div>
               {{/if}}
 
diff --git a/app/assets/stylesheets/common/base/login.scss b/app/assets/stylesheets/common/base/login.scss
index 7eb3537..de4a6a8 100644
--- a/app/assets/stylesheets/common/base/login.scss
+++ b/app/assets/stylesheets/common/base/login.scss
@@ -140,7 +140,7 @@
         border: 1px solid var(--tertiary);
         box-shadow: 0 0 0 2px rgba(var(--tertiary-rgb), 0.25);
       }
-      label.more-info {
+      span.more-info {
         color: var(--primary-medium);
         min-height: 1.4em; // prevents height increase due to tips
       }

GitHub sha: 8fee32d277608f34c3c272e55fb44c5f81284e14

This commit appears in #13289 which was approved by CvX. It was merged by pmusaraj.