You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
EditContext intercepts input after focus is programmatically transferred #1458
newEditorView({doc: `hello world `,extensions: [],parent: document.getElementById('editor-root'),});document.querySelector('button').onfocus=()=>document.querySelector('input').focus();
Repro recording
repro.mp4
Repro step
Click inside the text editor to set focus
Click "transfer focus" button
Observe blinking cursor in text input
Type anything
Expect: text input to receive all keyboard events
Actual: editor receives all keyboard events
Set EditorView.EDIT_CONTEXT = false;
Repeat steps, observe that issue goes away
Additional context
I need to move focus from one element to another as part of an accessibility focus trap implementation. In the real code, the element that transfers focus are dummy elements at the beginning and end of the focus trapped area.
That appears to be another bug in Chrome's implementation of EditContext. I've reported it as issue 375711382. Until they fix it, the only advice I can offer is to set up your event handlers to avoid triggering this.
Activity
marijnh commentedon Oct 27, 2024
That appears to be another bug in Chrome's implementation of
EditContext. I've reported it as issue 375711382. Until they fix it, the only advice I can offer is to set up your event handlers to avoid triggering this.chuanqisun commentedon Oct 28, 2024
Thank you for distilling the repro and reporting to Chrome.
vezaynk commentedon Apr 23, 2025
Thank you for this issue. Adding
EditorView.EDIT_CONTEXT = false;did fix the trick for us. Not sure what we're losing out on by doing it.kjk commentedon Jul 7, 2025
FYI: this was apparently fixed in Chrome per https://issues.chromium.org/issues/375711382
marijnh commentedon Jul 7, 2025
Great! I'll close this then.