mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-17 21:43:06 +00:00
Typing a message, pasting an image, then pressing Enter did nothing: the composer held the full draft, the send button was enabled, and Enter was inert until the user clicked back into the textarea — which reads as "the textarea needs a text change before it will submit". The send gating was never at fault. Radix's modal `DialogContent` always cancels its default close-focus restore and focuses `context.triggerRef.current` instead. `DragDropModal` — the "Select Upload Type" dialog a paste or a drop opens — is opened programmatically and so has no `Dialog.Trigger`, leaving that ref null: nothing is focused and focus falls to `document.body` when the dialog unmounts. Enter-to-send is a keydown handler on the textarea, so from `body` it is never reached. `UploadModalProvider` now records the element the upload was started from, captured in `openModal` before the dialog mounts (an effect runs too late — Radix has already moved focus), and restores it once the dialog closes, queued behind Radix's own deferred restore. This covers every close path: picking a destination, Cancel, Escape, and dismissing the overlay. `OGDialog`'s existing `triggerRef` seam does not reach this case, since it only fires through Radix's `onOpenChange` and choosing an upload destination calls `closeModal()` directly. |
||
|---|---|---|
| .. | ||
| public | ||
| scripts | ||
| src | ||
| sw | ||
| test | ||
| babel.config.cjs | ||
| check_updates.sh | ||
| index.html | ||
| jest.config.cjs | ||
| jest.resolver.cjs | ||
| nginx.conf | ||
| package.json | ||
| postcss.config.cjs | ||
| tailwind.config.cjs | ||
| tsconfig.json | ||
| vite.config.ts | ||