(value: string)
| 132 | defaultSearchDebounceMs, |
| 133 | ); |
| 134 | const onValueChanged = (value: string) => { |
| 135 | typedQuery.current = value; |
| 136 | |
| 137 | if (!value.length) { |
| 138 | setQuery(''); |
| 139 | initialQuery.current = ''; |
| 140 | onClearQuery?.(); |
| 141 | setIsFocused(false); |
| 142 | return; |
| 143 | } |
| 144 | |
| 145 | if (value && value !== initialQueryProp) { |
| 146 | debounceQuery(value); |
| 147 | } |
| 148 | |
| 149 | if (value !== initialQuery.current) { |
| 150 | setIsFocused(true); |
| 151 | } |
| 152 | }; |
| 153 | |
| 154 | useEffect(() => { |
| 155 | if (autoFocus) { |
nothing calls this directly
no test coverage detected