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 }) => (
|
||||
<Select
|
||||
{...rest}
|
||||
onClick={() => setOpen(!open)}
|
||||
onOpenChange={() => setOpen(false)}
|
||||
selected={
|
||||
isSelectBasedOptions(options)
|
||||
|
@ -173,12 +172,16 @@ export const TypeaheadSelectControl = <
|
|||
.map((o) => o.value)
|
||||
: field.value
|
||||
}
|
||||
shouldFocusFirstItemOnOpen={false}
|
||||
toggle={(ref) => (
|
||||
<MenuToggle
|
||||
ref={ref}
|
||||
id={id || name.slice(name.lastIndexOf(".") + 1)}
|
||||
variant="typeahead"
|
||||
onClick={() => setOpen(!open)}
|
||||
onClick={() => {
|
||||
setOpen(!open);
|
||||
textInputRef.current?.focus();
|
||||
}}
|
||||
isExpanded={open}
|
||||
isFullWidth
|
||||
status={get(errors, name) ? MenuToggleStatus.danger : undefined}
|
||||
|
|
Loading…
Reference in a new issue