Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions sources/components/AgentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,21 @@ export const AgentInput = React.memo(React.forwardRef<MultiTextInputHandle, Agen
};
}, [isCodex, props.modelMode, props.onModelModeChange]);

// Add window focus handler to restore focus to input on web
React.useEffect(() => {
if (Platform.OS !== 'web') return;

const handleWindowFocus = () => {
// Restore focus to the input when window regains focus
inputRef.current?.focus();
};

window.addEventListener('focus', handleWindowFocus);
return () => {
window.removeEventListener('focus', handleWindowFocus);
};
}, []);



return (
Expand Down