ant-design / pro-chat

🤖 Components Library for Quickly Building LLM Chat Interfaces.
https://pro-chat.antdigital.dev
MIT License
667 stars 83 forks source link

🐛[BUG] 在 loading 状态应该禁止输入回车换行。 #283

Closed gin-lsl closed 1 month ago

gin-lsl commented 1 month ago

🐛 bug 描述

在 loading 状态应该禁止输入回车换行。

📷 复现步骤

https://pro-chat.antdigital.dev/guide/servers-push

在 Loading 状态,不输入任何文本内容,直接输入回车,会换行。这个应该是没有必要的。

🏞 期望结果

💻 复现代码

可复现 demo

© 版本信息

🚑 其他信息

ONLY-yours commented 1 month ago

最近也在思考这个问题,现在是不允许在发送消息了,但是能输入内容

有些时候 SSE 还没结束的,但是用户依然想要编辑内容,可能会出现这种情况

gin-lsl commented 1 month ago

消息能输入是对的,不过回车换行(没有按下 Shift)最好能屏蔽掉。

目前是这样的逻辑:

https://github.com/user-attachments/assets/197aacb6-b431-4a70-96c1-106218a0c0bf