I’ve been experiencing an issue with ChatGPT where typing while the cursor is outside the message composer no longer automatically places text into the composer.
This previously worked correctly. Now, clicking anywhere outside of the composer and in the conversation and typing causes a focus outline to appear around the conversation instead, and with no text automatically placed in the composer.
After extensive troubleshooting, I found (ChatGPT actually found) a working solution.
Symptoms
-
Typing outside the composer doesn’t automatically focus the input field.
-
An orange focus border appears around the conversation area.
-
Pressing Shift + Esc manually focuses the composer.
-
Clearing browser data, disabling extensions, testing another browser profile, and changing accessibility settings did not resolve the problem.
What we discovered
Using Brave’s Developer Tools, we confirmed that keyboard focus was landing on the conversation container:
role="region" aria-label="Conversation" tabindex="0"
We also confirmed that the message composer uses a ProseMirror editor and can receive focus programmatically.
Working solution: Tampermonkey userscript
-
Install the Tampermonkey extension from the Chrome Web Store.
-
Create a new userscript.
-
Paste the JavaScript below.
-
Save and enable the script.
-
Refresh ChatGPT.
// ==UserScript==
// @name ChatGPT Type-to-Focus Fix
// @namespace local.chatgpt.focus
// @version 2.0
// @description Restore type-to-focus in ChatGPT
// @match https://chatgpt.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
(() => {
'use strict';
function findComposer() {
return document.querySelector(
'#prompt-textarea[contenteditable="true"], ' +
'div.ProseMirror[contenteditable="true"]'
);
}
function isEditable(element) {
return !!element.closest(
'input, textarea, select, ' +
'[contenteditable], [role="textbox"]'
);
}
function isInteractive(element) {
return !!element.closest(
'button, a, [role="button"], ' +
'[role="menu"], [role="menuitem"], ' +
'[role="dialog"], [role="listbox"], ' +
'[role="option"], [role="combobox"], ' +
'[role="tab"], [role="slider"], ' +
'[role="checkbox"], [role="radio"]'
);
}
document.addEventListener('keydown', (event) => {
if (
event.defaultPrevented ||
event.isComposing ||
!event.isTrusted ||
event.ctrlKey ||
event.altKey ||
event.metaKey ||
event.key.length !== 1
) {
return;
}
const target = event.target;
if (!(target instanceof Element)) return;
if (isEditable(target)) return;
if (isInteractive(target)) return;
const active = document.activeElement;
if (
active instanceof Element &&
(isEditable(active) || isInteractive(active))
) {
return;
}
const composer = findComposer();
if (!composer) return;
// Avoid interfering with modifier shortcuts.
// Move focus into the composer.
composer.focus();
if (document.activeElement !== composer) return;
// Insert the character that triggered the focus.
event.preventDefault();
const inserted = document.execCommand(
'insertText',
false,
event.key
);
if (!inserted) {
console.warn(
'ChatGPT Type-to-Focus: insertion failed'
);
}
}, true);
console.info('ChatGPT Type-to-Focus Fix v2.0 loaded');
})();
Be sure to Ctrl+Shift+R to Refresh the screen.
Result
Confirmed working in Brave on Windows.
I can now click outside the composer and begin typing, and my text automatically appears in the message field again.
This is an unofficial workaround, not a permanent fix. It may need updating if ChatGPT changes its interface. It also uses the legacy execCommand API.
Hopefully, OpenAI can restore the original automatic-focus behavior so users don’t need a browser extension workaround to accomplish something that previously worked seamlessly.