Skip to content

Commit

Permalink
feat(autocomplete): make autoHighlight configurable. Fixes #559 (#560)
Browse files Browse the repository at this point in the history
* fix: remove autoHighlight on autocomplete by default

Signed-off-by: Adrien Delannoy <[email protected]>

* update default to `true` with a comment about upstream

Signed-off-by: Anton Gilgur <[email protected]>

---------

Signed-off-by: Adrien Delannoy <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
Co-authored-by: Anton Gilgur <[email protected]>
  • Loading branch information
Adrien-D and agilgur5 authored Jun 8, 2024
1 parent 4f102b1 commit 2c503a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/autocomplete/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface AutocompleteProps {
autoCompleteRef?: (api: AutocompleteApi) => any;
filterSuggestions?: boolean;
qeid?: string;
autoHighlight?: true; // ReactAutocomplete.Props['autoHighlight'] is missing the `true` default per https://github.com/argoproj/argo-ui/pull/560#issuecomment-2155872347
}

export const Autocomplete = (props: AutocompleteProps) => {
Expand Down Expand Up @@ -57,7 +58,7 @@ export const Autocomplete = (props: AutocompleteProps) => {
wrapperProps.className = classNames('select', wrapperProps.className);
return (
<ReactAutocomplete
autoHighlight={true}
autoHighlight={props.autoHighlight}
ref={(el: any) => {
if (el) {
if (el.refs.input) {
Expand Down

0 comments on commit 2c503a8

Please sign in to comment.