Fix autocomplete not clearing

This commit is contained in:
7w1 committed 2026-02-20 15:19:16 -06:00
1 parent 929d6b74e4
commit ccf6df4f00
1 file changed
+7
+7
View File
@@ -150,6 +150,8 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
const sendTypingStatus = useTypingStatusUpdater(mx, roomId);
const [inputKey, setInputKey] = useState(0);
const handleFiles = useCallback(
async (files: File[]) => {
setUploadBoard(true);
@@ -349,8 +351,12 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
}
}
mx.sendMessage(roomId, content as any);
resetEditor(editor);
resetEditorHistory(editor);
setInputKey(prev => prev + 1);
setReplyDraft(undefined);
sendTypingStatus(false);
}, [mx, roomId, editor, replyDraft, sendTypingStatus, setReplyDraft, isMarkdown, commands]);
@@ -515,6 +521,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
<CustomEditor
editableName="RoomInput"
editor={editor}
key={inputKey}
placeholder="Send a message..."
onKeyDown={handleKeyDown}
onKeyUp={handleKeyUp}