瀏覽代碼

输入框优化

jackson 11 月之前
父節點
當前提交
1ba2449427
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      example/src/RoomPage.tsx

+ 1 - 0
example/src/RoomPage.tsx

@@ -56,6 +56,7 @@ export const RoomPage = () => {
     const textField = document.getElementById('entry') as HTMLInputElement;
     const chat = document.getElementById('chat') as HTMLDivElement;
     if (textField.value.trim()) {
+      textField.focus();
       const msg = encoder.encode(textField.value);
       currentRoom.localParticipant.publishData(msg, 0);
       chat.innerHTML += `<div style="color:yellow">${currentRoom.localParticipant.identity} (me): ${textField.value}</div>`;