(raw: string = value)
| 101 | }, [activeSuggestion, showSuggestions]) |
| 102 | |
| 103 | const submit = (raw: string = value): void => { |
| 104 | const v = raw.trim() |
| 105 | if (!v && !options.allowEmptySubmit) return |
| 106 | const err = options.validate?.(v) ?? null |
| 107 | if (err) { |
| 108 | setError(err) |
| 109 | return |
| 110 | } |
| 111 | onSubmit(v) |
| 112 | } |
| 113 | |
| 114 | // Picking a suggestion submits it directly (e.g. create in that folder). |
| 115 | const chooseSuggestion = (next: PromptSuggestion): void => { |
no outgoing calls
no test coverage detected