fix(files): scope go-to-line shortcut to editor focus

This commit is contained in:
Bohdan Triapitsyn
2026-04-17 11:17:52 +03:00
parent ef4c6ee163
commit f88decdf9b
@@ -2077,6 +2077,19 @@ export const FilesView: React.FC<FilesViewProps> = ({ mode = 'full' }) => {
return;
}
const isTypingTarget = Boolean(
target?.closest('input, textarea, [contenteditable="true"], [role="textbox"]')
);
if (isTypingTarget) {
return;
}
const activeElement = document.activeElement as Element | null;
const editorHasFocus = Boolean(activeElement?.closest('.cm-editor'));
if (!editorHasFocus) {
return;
}
if (event.altKey && !event.metaKey && !event.ctrlKey && !event.shiftKey && event.code === 'KeyG') {
event.preventDefault();
setIsGoToLineOpen(true);