|
@@ -144,6 +144,12 @@ export const ClassroomLayout = ({ children, role }: ClassroomLayoutProps) => {
|
|
|
<textarea
|
|
<textarea
|
|
|
value={msgText}
|
|
value={msgText}
|
|
|
onChange={(e) => setMsgText(e.target.value)}
|
|
onChange={(e) => setMsgText(e.target.value)}
|
|
|
|
|
+ onKeyDown={(e) => {
|
|
|
|
|
+ if (e.key === 'Enter' && !e.shiftKey) {
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ sendMessage();
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
className="w-full border rounded px-2 py-1 pr-10"
|
|
className="w-full border rounded px-2 py-1 pr-10"
|
|
|
placeholder="输入消息..."
|
|
placeholder="输入消息..."
|
|
|
rows={3}
|
|
rows={3}
|