DashboardSave: Autofocus save dashboard form input (#22748)

pull/22753/head
Dominik Prokop 6 years ago committed by GitHub
parent b51e28bc15
commit b441b73345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx
  2. 7
      public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx

@ -75,7 +75,12 @@ export const SaveDashboardAsForm: React.FC<SaveDashboardFormProps & { isNew?: bo
{({ register, control, errors }) => (
<>
<Forms.Field label="Dashboard name" invalid={!!errors.title} error="Dashboard name is required">
<Forms.Input name="title" ref={register({ required: true })} aria-label="Save dashboard title field" />
<Forms.Input
name="title"
ref={register({ required: true })}
aria-label="Save dashboard title field"
autoFocus
/>
</Forms.Field>
<Forms.Field label="Folder">
<Forms.InputControl

@ -31,7 +31,12 @@ export const SaveDashboardForm: React.FC<SaveDashboardFormProps> = ({ dashboard,
{({ register, errors }) => (
<>
<Forms.Field label="Changes description">
<Forms.TextArea name="message" ref={register} placeholder="Add a note to describe your changes..." />
<Forms.TextArea
name="message"
ref={register}
placeholder="Add a note to describe your changes..."
autoFocus
/>
</Forms.Field>
{hasTimeChanged && (
<Forms.Field label="Save current time range" description="Dashboard time range has changed">

Loading…
Cancel
Save