History

fix(web): keep thread rename open during IME composition (#6281)

Michael Charles Aubrey committed 3 months ago

Commit 4a2f8b01 parent 8f9ab082 files · +2 −0Browse files

Unified · Split

2 files
  1. apps/web/src/components/Sidebar.tsx +1 −0
  2. apps/web/src/components/chat/ChatHeader.tsx +1 −0
apps/web/src/components/Sidebar.tsx+1−0
@@ -935,6 +935,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { · 934 unmodified lines
935935 const handleRenameKeyDown = useCallback(
936936 (event: ReactKeyboardEvent<HTMLInputElement>) => {
937937 event.stopPropagation();
938+ if (event.nativeEvent.isComposing || event.keyCode === 229) return;
938939 if (event.key === "Enter") {
939940 event.preventDefault();
940941 renameCommittedRef.current = true;
apps/web/src/components/chat/ChatHeader.tsx+1−0
@@ -203,6 +203,7 @@ export const ChatHeader = memo(function ChatHeader({ · 202 unmodified lines
203203 );
204204 const handleRenameKeyDown = useCallback(
205205 (event: ReactKeyboardEvent<HTMLInputElement>) => {
206+ if (event.nativeEvent.isComposing || event.keyCode === 229) return;
206207 if (event.key === "Enter") {
207208 renameCommittedRef.current = true;
208209 commitRename(event.currentTarget.value);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t