MCPcopy Index your code
hub / github.com/JedWatson/react-select / onInputChange

Function onInputChange

docs/examples/OnSelectResetsInput.tsx:8–18  ·  view source on GitHub ↗
(
    inputValue: string,
    { action, prevInputValue }: InputActionMeta
  )

Source from the content-addressed store, hash-verified

6 const [menuIsOpen, setMenuIsOpen] = React.useState<boolean>();
7
8 const onInputChange = (
9 inputValue: string,
10 { action, prevInputValue }: InputActionMeta
11 ) => {
12 if (action === 'input-change') return inputValue;
13 if (action === 'menu-close') {
14 if (prevInputValue) setMenuIsOpen(true);
15 else setMenuIsOpen(undefined);
16 }
17 return prevInputValue;
18 };
19
20 return (
21 <Select

Callers 1

handleInputChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…