Skip to content

Commit

Permalink
feat(ui): set autofocus on first form item
Browse files Browse the repository at this point in the history
  • Loading branch information
ncarlier committed May 10, 2019
1 parent f552240 commit 1329000
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/src/articles/components/AddArticleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const AddArticleForm = ({ value, category, onSuccess, onCancel, showMessage }: A
{...url('url')}
error={!formState.validity.url}
required
autoFocus
ref={onMountValidator.bind}
/>
</form>
Expand Down
1 change: 1 addition & 0 deletions ui/src/common/FormInputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface Props {
label: string
required?: boolean
readOnly?: boolean
autoFocus?: boolean
error?: boolean
children?: ReactNode
}
Expand Down
1 change: 1 addition & 0 deletions ui/src/settings/api-keys/AddApiKeyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const AddApiKeyForm = ({ history, showMessage }: AllProps) => {
{...text('alias')}
error={!formState.validity.alias}
required
autoFocus
ref={onMountValidator.bind}
/>
</form>
Expand Down
1 change: 1 addition & 0 deletions ui/src/settings/api-keys/EditApiKeyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const EditApiKeyForm = ({ data, history, showMessage }: AllProps) => {
{...text('alias')}
error={!formState.validity.alias}
required
autoFocus
ref={onMountValidator.bind}
/>
</form>
Expand Down
1 change: 1 addition & 0 deletions ui/src/settings/archive-services/AddArchiveServiceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const AddArchiveServiceForm = ({ history, showMessage }: AllProps) => {
{...text('alias')}
error={!formState.validity.alias}
required
autoFocus
ref={onMountValidator.bind}
/>
<FormSelectField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const EditArchiveServiceForm = ({ data, history, showMessage }: AllProps)
{...text('alias')}
error={!formState.validity.alias}
required
autoFocus
ref={onMountValidator.bind}
/>
<FormSelectField label="Provider" {...select('provider')} ref={onMountValidator.bind}>
Expand Down
1 change: 1 addition & 0 deletions ui/src/settings/categories/AddCategoryForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const AddCategoryForm = ({ history, showMessage }: AllProps) => {
{...text('title')}
error={!formState.validity.title}
required
autoFocus
ref={onMountValidator.bind}
/>
</form>
Expand Down
1 change: 1 addition & 0 deletions ui/src/settings/categories/EditCategoryForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const EditCategoryForm = ({ category, history, showMessage }: AllProps) =
{...text('title')}
error={!formState.validity.title}
required
autoFocus
ref={onMountValidator.bind}
/>
</form>
Expand Down
1 change: 1 addition & 0 deletions ui/src/settings/rules/AddRuleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const AddRuleForm = ({ history, showMessage }: AllProps) => {
{...text('alias')}
error={!formState.validity.alias}
required
autoFocus
ref={onMountValidator.bind}
/>
<FormTextareaField
Expand Down
1 change: 1 addition & 0 deletions ui/src/settings/rules/EditRuleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const EditRuleForm = ({ data, history, showMessage }: AllProps) => {
{...text('alias')}
error={!formState.validity.alias}
required
autoFocus
ref={onMountValidator.bind}
/>
<FormTextareaField
Expand Down

0 comments on commit 1329000

Please sign in to comment.