()
| 77 | setCursor(0); |
| 78 | setAnchor(null); |
| 79 | setAttachments([]); |
| 80 | histIdx.current = null; |
| 81 | }; |
| 82 | |
| 83 | const submit = () => { |
| 84 | const parts: string[] = []; |
| 85 | if (value.trim()) parts.push(value); |
| 86 | for (const a of attachments) parts.push(a.payload); |
| 87 | const full = parts.join('\n').trim(); |
| 88 | if (!full) return; |
| 89 | onSubmit(full); |
| 90 | onChange(''); |
| 91 | setCursor(0); |
| 92 | setAnchor(null); |
| 93 | setAttachments([]); |
| 94 | histIdx.current = null; |