focus input on first click (#34283)
fixes: #34054 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
4d25128018
commit
b57b0bec88
1 changed files with 5 additions and 2 deletions
|
@ -160,7 +160,6 @@ export const TypeaheadSelectControl = <
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<Select
|
<Select
|
||||||
{...rest}
|
{...rest}
|
||||||
onClick={() => setOpen(!open)}
|
|
||||||
onOpenChange={() => setOpen(false)}
|
onOpenChange={() => setOpen(false)}
|
||||||
selected={
|
selected={
|
||||||
isSelectBasedOptions(options)
|
isSelectBasedOptions(options)
|
||||||
|
@ -173,12 +172,16 @@ export const TypeaheadSelectControl = <
|
||||||
.map((o) => o.value)
|
.map((o) => o.value)
|
||||||
: field.value
|
: field.value
|
||||||
}
|
}
|
||||||
|
shouldFocusFirstItemOnOpen={false}
|
||||||
toggle={(ref) => (
|
toggle={(ref) => (
|
||||||
<MenuToggle
|
<MenuToggle
|
||||||
ref={ref}
|
ref={ref}
|
||||||
id={id || name.slice(name.lastIndexOf(".") + 1)}
|
id={id || name.slice(name.lastIndexOf(".") + 1)}
|
||||||
variant="typeahead"
|
variant="typeahead"
|
||||||
onClick={() => setOpen(!open)}
|
onClick={() => {
|
||||||
|
setOpen(!open);
|
||||||
|
textInputRef.current?.focus();
|
||||||
|
}}
|
||||||
isExpanded={open}
|
isExpanded={open}
|
||||||
isFullWidth
|
isFullWidth
|
||||||
status={get(errors, name) ? MenuToggleStatus.danger : undefined}
|
status={get(errors, name) ? MenuToggleStatus.danger : undefined}
|
||||||
|
|
Loading…
Reference in a new issue