소스 검색

输入框优化

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>`;