aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-03-02 16:24:54 +0100
committerGitHub <noreply@github.com>2018-03-02 16:24:54 +0100
commit59c992d35dc045d829ef82a592e2576e98873467 (patch)
tree8ddfa7698fa427bd30d7afa94605f5aaac9b208b
parent299cebedac5ef4a6a17dd18782c2b1a2a79f08d5 (diff)
downloadsonarqube-59c992d35dc045d829ef82a592e2576e98873467.tar.gz
sonarqube-59c992d35dc045d829ef82a592e2576e98873467.zip
focus first field in the user form (#3112)
-rw-r--r--server/sonar-web/src/main/js/apps/users/components/UserForm.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
index 95ccccce126..c3c4e670af0 100644
--- a/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
+++ b/server/sonar-web/src/main/js/apps/users/components/UserForm.tsx
@@ -24,7 +24,7 @@ import { createUser, updateUser } from '../../../api/users';
import { User } from '../../../app/types';
import throwGlobalError from '../../../app/utils/throwGlobalError';
import Modal from '../../../components/controls/Modal';
-import { Button, SubmitButton, ResetButtonLink } from '../../../components/ui/buttons';
+import { Button, ResetButtonLink, SubmitButton } from '../../../components/ui/buttons';
import { translate, translateWithParameters } from '../../../helpers/l10n';
import { parseError } from '../../../helpers/request';
@@ -174,6 +174,7 @@ export default class UserForm extends React.PureComponent<Props, State> {
{/* keep this fake field to hack browser autofill */}
<input className="hidden" name="login-fake" type="text" />
<input
+ autoFocus={true}
id="create-user-login"
maxLength={255}
minLength={3}
@@ -194,6 +195,7 @@ export default class UserForm extends React.PureComponent<Props, State> {
{/* keep this fake field to hack browser autofill */}
<input className="hidden" name="name-fake" type="text" />
<input
+ autoFocus={!!user}
id="create-user-name"
maxLength={200}
name="name"