Skip to content

Commit

Permalink
fix the state issue of text field in auto complete
Browse files Browse the repository at this point in the history
  • Loading branch information
DilshanSenarath committed Jan 26, 2025
1 parent 700d579 commit 68559bd
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import Autocomplete, {
AutocompleteInputChangeReason,
AutocompleteRenderGetTagProps,
AutocompleteRenderInputParams
} from "@oxygen-ui/react/Autocomplete";
Expand Down Expand Up @@ -762,9 +763,17 @@ export const GeneralDetailsForm: FunctionComponent<GeneralDetailsFormPopsInterfa
setSelectedGroupsFromUserStore(updatedGroups);
} }
filterOptions={ (groups: GroupMetadataInterface[]) => groups }
inputValue={ searchTerm }
onInputChange={
(_event: SyntheticEvent, searchTerm: string) =>
setSearchTerm(searchTerm)
(
_event: SyntheticEvent,
searchTerm: string,
reason: AutocompleteInputChangeReason
) => {
if (reason === "input") {
setSearchTerm(searchTerm);
}
}
}
isOptionEqualToValue={
(option: GroupMetadataInterface, value: GroupMetadataInterface) =>
Expand Down

0 comments on commit 68559bd

Please sign in to comment.