Search: Auto focus input elements (#61443)

This commit is contained in:
Ryan McKinley
2023-01-13 16:01:47 +00:00
committed by GitHub
parent 370272e57e
commit ce3a96abec
2 changed files with 3 additions and 0 deletions
@@ -26,6 +26,8 @@ export function DashboardSearch({}: Props) {
<div> <div>
<input <input
type="text" type="text"
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
placeholder={state.includePanels ? 'Search dashboards and panels by name' : 'Search dashboards by name'} placeholder={state.includePanels ? 'Search dashboards and panels by name' : 'Search dashboards by name'}
value={state.query ?? ''} value={state.query ?? ''}
onChange={(e) => stateManager.onQueryChange(e.currentTarget.value)} onChange={(e) => stateManager.onQueryChange(e.currentTarget.value)}
@@ -46,6 +46,7 @@ export const ManageDashboardsNew = React.memo(({ folder }: Props) => {
value={state.query ?? ''} value={state.query ?? ''}
onChange={(e) => stateManager.onQueryChange(e.currentTarget.value)} onChange={(e) => stateManager.onQueryChange(e.currentTarget.value)}
onKeyDown={onKeyDown} onKeyDown={onKeyDown}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus autoFocus
spellCheck={false} spellCheck={false}
placeholder={state.includePanels ? 'Search for dashboards and panels' : 'Search for dashboards'} placeholder={state.includePanels ? 'Search for dashboards and panels' : 'Search for dashboards'}