diff --git a/packages/react-core/src/components/SearchInput/SearchInput.tsx b/packages/react-core/src/components/SearchInput/SearchInput.tsx index 630cc325c24..4a3a4dd7d8f 100644 --- a/packages/react-core/src/components/SearchInput/SearchInput.tsx +++ b/packages/react-core/src/components/SearchInput/SearchInput.tsx @@ -206,7 +206,7 @@ const SearchInputBase: React.FunctionComponent = ({ setIsSearchMenuOpen(isAdvancedSearchOpen); }, [isAdvancedSearchOpen]); - const onChangeHandler = (value: string, event: React.FormEvent) => { + const onChangeHandler = (event: React.FormEvent, value: string) => { if (onChange) { onChange(value, event); } diff --git a/packages/react-core/src/components/TextInputGroup/TextInputGroupMain.tsx b/packages/react-core/src/components/TextInputGroup/TextInputGroupMain.tsx index 4328b24eab6..bda153f96f3 100644 --- a/packages/react-core/src/components/TextInputGroup/TextInputGroupMain.tsx +++ b/packages/react-core/src/components/TextInputGroup/TextInputGroupMain.tsx @@ -26,7 +26,7 @@ export interface TextInputGroupMainProps extends Omit) => void; + onChange?: (event: React.FormEvent, value: string) => void; /** Callback for when the input field is focused*/ onFocus?: (event?: any) => void; /** Callback for when focus is lost on the input field*/ @@ -61,7 +61,7 @@ export const TextInputGroupMain: React.FunctionComponent) => { - onChange(event.currentTarget.value, event); + onChange(event, event.currentTarget.value); }; return ( diff --git a/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupFilters.tsx b/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupFilters.tsx index 9e5c40d352a..0415a555e1c 100644 --- a/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupFilters.tsx +++ b/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupFilters.tsx @@ -27,7 +27,7 @@ export const TextInputGroupFilters: React.FunctionComponent = () => { const showSearchIcon = !currentChips.length; /** callback for updating the inputValue state in this component so that the input can be controlled */ - const handleInputChange = (value: string, _event: React.FormEvent) => { + const handleInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); }; diff --git a/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupUtilitiesAndIcon.tsx b/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupUtilitiesAndIcon.tsx index 828454d50ae..3e0cc9034d2 100644 --- a/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupUtilitiesAndIcon.tsx +++ b/packages/react-core/src/components/TextInputGroup/examples/TextInputGroupUtilitiesAndIcon.tsx @@ -7,7 +7,7 @@ export const TextInputGroupUtilitiesAndIcon: React.FunctionComponent = () => { const [inputValue, setInputValue] = React.useState(''); /** callback for updating the inputValue state in this component so that the input can be controlled */ - const handleInputChange = (value: string, _event: React.FormEvent) => { + const handleInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); }; diff --git a/packages/react-core/src/demos/ComposableMenu/examples/ComposableMultipleTypeaheadSelect.tsx b/packages/react-core/src/demos/ComposableMenu/examples/ComposableMultipleTypeaheadSelect.tsx index 813688048c3..f02e9689eb8 100644 --- a/packages/react-core/src/demos/ComposableMenu/examples/ComposableMultipleTypeaheadSelect.tsx +++ b/packages/react-core/src/demos/ComposableMenu/examples/ComposableMultipleTypeaheadSelect.tsx @@ -123,7 +123,7 @@ export const ComposableMultipleTypeaheadSelect: React.FunctionComponent = () => textInputRef.current?.focus(); }; - const onTextInputChange = (value: string) => { + const onTextInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); }; diff --git a/packages/react-core/src/demos/ComposableMenu/examples/ComposableTypeaheadSelect.tsx b/packages/react-core/src/demos/ComposableMenu/examples/ComposableTypeaheadSelect.tsx index 75538e5a6cd..60a44b7f63e 100644 --- a/packages/react-core/src/demos/ComposableMenu/examples/ComposableTypeaheadSelect.tsx +++ b/packages/react-core/src/demos/ComposableMenu/examples/ComposableTypeaheadSelect.tsx @@ -135,7 +135,7 @@ export const ComposableTypeaheadSelect: React.FunctionComponent = () => { textInputRef.current?.focus(); }; - const onTextInputChange = (value: string) => { + const onTextInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); setIsSelected(false); }; diff --git a/packages/react-core/src/demos/examples/TextInputGroup/AttributeValueFiltering.tsx b/packages/react-core/src/demos/examples/TextInputGroup/AttributeValueFiltering.tsx index a5b7457d4cc..4e5fb65076c 100644 --- a/packages/react-core/src/demos/examples/TextInputGroup/AttributeValueFiltering.tsx +++ b/packages/react-core/src/demos/examples/TextInputGroup/AttributeValueFiltering.tsx @@ -44,7 +44,7 @@ export const AttributeValueFiltering: React.FunctionComponent = () => { const textInputGroupRef = React.useRef(); /** callback for updating the inputValue state in this component so that the input can be controlled */ - const handleInputChange = (value: string, _event: React.FormEvent) => { + const handleInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); }; diff --git a/packages/react-core/src/demos/examples/TextInputGroup/AutoCompleteSearch.tsx b/packages/react-core/src/demos/examples/TextInputGroup/AutoCompleteSearch.tsx index d82745d47cf..cc4e3666f67 100644 --- a/packages/react-core/src/demos/examples/TextInputGroup/AutoCompleteSearch.tsx +++ b/packages/react-core/src/demos/examples/TextInputGroup/AutoCompleteSearch.tsx @@ -31,7 +31,7 @@ export const AutoCompleteSearch: React.FunctionComponent = () => { const textInputGroupRef = React.useRef(); /** callback for updating the inputValue state in this component so that the input can be controlled */ - const handleInputChange = (value: string, _event: React.FormEvent) => { + const handleInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); }; diff --git a/packages/react-core/src/next/components/Select/examples/SelectMultiTypeahead.tsx b/packages/react-core/src/next/components/Select/examples/SelectMultiTypeahead.tsx index 66f608b1d50..a61fd03fa94 100644 --- a/packages/react-core/src/next/components/Select/examples/SelectMultiTypeahead.tsx +++ b/packages/react-core/src/next/components/Select/examples/SelectMultiTypeahead.tsx @@ -109,7 +109,7 @@ export const SelectMultiTypeahead: React.FunctionComponent = () => { setIsOpen(!isOpen); }; - const onTextInputChange = (value: string) => { + const onTextInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); }; diff --git a/packages/react-core/src/next/components/Select/examples/SelectTypeahead.tsx b/packages/react-core/src/next/components/Select/examples/SelectTypeahead.tsx index 19f242e8ddf..1498f226f65 100644 --- a/packages/react-core/src/next/components/Select/examples/SelectTypeahead.tsx +++ b/packages/react-core/src/next/components/Select/examples/SelectTypeahead.tsx @@ -67,7 +67,7 @@ export const SelectBasic: React.FunctionComponent = () => { setFocusedItemIndex(null); }; - const onTextInputChange = (value: string) => { + const onTextInputChange = (_event: React.FormEvent, value: string) => { setInputValue(value); setFilterValue(value); };