]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15820 Can't create new user on Firefox (#7377)
authorDavid Cho-Lerat <117642976+david-cho-lerat-sonarsource@users.noreply.github.com>
Fri, 13 Jan 2023 08:30:38 +0000 (09:30 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 13 Jan 2023 20:02:46 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UserForm-test.tsx.snap

index 7f5dc23d0222eeb915f9917bf0bbcb32dfeaa020..c45da28192abbe48b5ddb5bfaece378b408f6af7 100644 (file)
@@ -176,9 +176,8 @@ export default class UserForm extends React.PureComponent<Props, State> {
                     {translate('login')}
                     <MandatoryFieldMarker />
                   </label>
-                  {/* keep this fake field to hack browser autofill */}
-                  <input className="hidden" name="login-fake" type="text" />
                   <input
+                    autoComplete="off"
                     autoFocus={true}
                     id="create-user-login"
                     maxLength={255}
@@ -197,9 +196,8 @@ export default class UserForm extends React.PureComponent<Props, State> {
                   {translate('name')}
                   <MandatoryFieldMarker />
                 </label>
-                {/* keep this fake field to hack browser autofill */}
-                <input className="hidden" name="name-fake" type="text" />
                 <input
+                  autoComplete="off"
                   autoFocus={!!user}
                   disabled={user && !user.local}
                   id="create-user-name"
@@ -213,9 +211,8 @@ export default class UserForm extends React.PureComponent<Props, State> {
               </div>
               <div className="modal-field">
                 <label htmlFor="create-user-email">{translate('users.email')}</label>
-                {/* keep this fake field to hack browser autofill */}
-                <input className="hidden" name="email-fake" type="email" />
                 <input
+                  autoComplete="off"
                   disabled={user && !user.local}
                   id="create-user-email"
                   maxLength={100}
@@ -231,9 +228,8 @@ export default class UserForm extends React.PureComponent<Props, State> {
                     {translate('password')}
                     <MandatoryFieldMarker />
                   </label>
-                  {/* keep this fake field to hack browser autofill */}
-                  <input className="hidden" name="password-fake" type="password" />
                   <input
+                    autoComplete="off"
                     id="create-user-password"
                     name="password"
                     onChange={this.handlePasswordChange}
index 793ddc69999d5342e552736c62be8079405d303c..d081432b1790c2d5111703459b8ec905e99f2499 100644 (file)
@@ -34,11 +34,7 @@ exports[`should render correctly 1`] = `
           <MandatoryFieldMarker />
         </label>
         <input
-          className="hidden"
-          name="name-fake"
-          type="text"
-        />
-        <input
+          autoComplete="off"
           autoFocus={true}
           disabled={false}
           id="create-user-name"
@@ -59,11 +55,7 @@ exports[`should render correctly 1`] = `
           users.email
         </label>
         <input
-          className="hidden"
-          name="email-fake"
-          type="email"
-        />
-        <input
+          autoComplete="off"
           disabled={false}
           id="create-user-email"
           maxLength={100}
@@ -148,11 +140,7 @@ exports[`should render correctly 2`] = `
           <MandatoryFieldMarker />
         </label>
         <input
-          className="hidden"
-          name="login-fake"
-          type="text"
-        />
-        <input
+          autoComplete="off"
           autoFocus={true}
           id="create-user-login"
           maxLength={255}
@@ -179,11 +167,7 @@ exports[`should render correctly 2`] = `
           <MandatoryFieldMarker />
         </label>
         <input
-          className="hidden"
-          name="name-fake"
-          type="text"
-        />
-        <input
+          autoComplete="off"
           autoFocus={false}
           id="create-user-name"
           maxLength={200}
@@ -203,11 +187,7 @@ exports[`should render correctly 2`] = `
           users.email
         </label>
         <input
-          className="hidden"
-          name="email-fake"
-          type="email"
-        />
-        <input
+          autoComplete="off"
           id="create-user-email"
           maxLength={100}
           name="email"
@@ -226,11 +206,7 @@ exports[`should render correctly 2`] = `
           <MandatoryFieldMarker />
         </label>
         <input
-          className="hidden"
-          name="password-fake"
-          type="password"
-        />
-        <input
+          autoComplete="off"
           id="create-user-password"
           name="password"
           onChange={[Function]}