Skip to content

Commit e3d5ea5

Browse files
committed
fix input select saved filter
1 parent d71e0d4 commit e3d5ea5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

opencti-platform/opencti-front/src/components/saved_filters/SavedFiltersAutocomplete.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ type SavedFiltersAutocompleteProps = {
1616
onDelete?: (value: SavedFiltersSelectionData) => void;
1717
options?: AutocompleteOptionType[];
1818
};
19-
const SavedFiltersAutocomplete = ({ isDisabled, value, inputValue, onSelect, onDelete, options }: SavedFiltersAutocompleteProps) => {
19+
const SavedFiltersAutocomplete = ({ isDisabled, value, onSelect, onDelete, options }: SavedFiltersAutocompleteProps) => {
2020
const { t_i18n } = useFormatter();
21+
const [inputValue, setInputValue] = React.useState('');
2122

2223
const handleDelete = (option: SavedFiltersSelectionData) => (event: SyntheticEvent) => {
2324
event.stopPropagation();
@@ -55,6 +56,12 @@ const SavedFiltersAutocomplete = ({ isDisabled, value, inputValue, onSelect, onD
5556
disablePortal
5657
disableClearable
5758
onChange={(_, selectedOption: AutocompleteOptionType) => onSelect?.(selectedOption)}
59+
onInputChange={(event, newValue, reason) => {
60+
if (reason === 'reset') {
61+
return;
62+
}
63+
setInputValue(newValue);
64+
}}
5865
renderOption={renderOption}
5966
renderInput={(params) => (
6067
<TextField

0 commit comments

Comments
 (0)