Explorar o código

输入框优化

jackson hai 11 meses
pai
achega
1ba2449427
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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>`;