Skip to content

Commit 1d1e1c6

Browse files
Merge pull request #4778 from specify/issue-4753
Keep focus on xml code and not on linter after error
2 parents cb4188d + 32dcb1f commit 1d1e1c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

specifyweb/frontend/js_src/lib/components/AppResources/EditorComponents.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ export function useCodeMirrorExtensions(
226226
function handleLinted(results: RA<Diagnostic>, view: EditorView): void {
227227
if (isFirstLint && results.length > 0) {
228228
isFirstLint = false;
229-
setTimeout(() => openLintPanel(view), 0);
229+
setTimeout(() => {
230+
const currentFocus = document.activeElement as HTMLElement | null;
231+
openLintPanel(view);
232+
currentFocus?.focus();
233+
}, 0);
230234
}
231235
setBlockers(
232236
filterArray(

0 commit comments

Comments
 (0)