휴대폰에서 채팅을 보낸 뒤에도 키보드 유지: "보내기" 버튼을 누르면 포커스가 버튼으로 넘어가 입력 칸이 빠지고 키보드가 내려가던 것을, 버튼의 pointerdown/mousedown 기본 동작을 막아(lib/chat-input keepFocus) 포커스를 입력 칸에 두고, 보낸 뒤에도 입력 칸에 포커스를 다시 줌. 방 채팅(ChatPanel)·그림 맞히기·마피아·라이어 게임 채팅 모두. Esc로 빠져나가기와 포커스가 빠질 때 "입력 중" 끄기는 그대로. chat.e2e.ts(휴대폰 시트에서 보내기 탭)와 games.e2e.ts(catchmind·mafia·liar 보내기 버튼)에 확인 추가, docs/07에 한 줄
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import type { PublicUser, ServerMessage } from '@bg/shared/lite';
|
||||
import { nameHue } from '../../components/ChatMessage';
|
||||
import { Avatar } from '../../components/ui';
|
||||
import { useServerNow } from '../../components/TurnTimer';
|
||||
import { keepFocus } from '../../lib/chat-input';
|
||||
import { haptic, noise, sfx, sounds, tone } from '../../lib/feedback';
|
||||
import { useWide } from '../../lib/media';
|
||||
import { socket } from '../../net/socket';
|
||||
@@ -1005,6 +1006,7 @@ function GuessPanel({ v, me, players, act, pending }: { v: CatchmindView; me: st
|
||||
if (!t || !enabled) return;
|
||||
act(v.canGuess ? { type: 'guess', text: t.slice(0, max) } : { type: 'chat', text: t.slice(0, max) });
|
||||
setText('');
|
||||
inputRef.current?.focus();
|
||||
}}
|
||||
>
|
||||
<input
|
||||
@@ -1020,7 +1022,7 @@ function GuessPanel({ v, me, players, act, pending }: { v: CatchmindView; me: st
|
||||
autoComplete="off"
|
||||
onKeyDown={(e) => e.key === 'Escape' && e.currentTarget.blur()}
|
||||
/>
|
||||
<button className="btn btn-primary" disabled={!enabled || !text.trim() || pending} style={{ minWidth: 72 }}>
|
||||
<button className="btn btn-primary" disabled={!enabled || !text.trim() || pending} style={{ minWidth: 72 }} {...keepFocus}>
|
||||
{v.canGuess && v.role !== 'solver' ? '맞히기' : '보내기'}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user