Skip to content

Commit f9e500d

Browse files
committed
fix: CodeEditor - "Calls to EditorView.update are not allowed while an update is in progress" sentry fix
1 parent a7c0607 commit f9e500d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Common/CodeMirror/Extensions/findAndReplace.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,11 @@ export const codeEditorFindReplace = (view: EditorView): Panel => {
457457
}
458458

459459
const mount = () => {
460-
const findField = document.querySelector('[data-code-editor-find]') as HTMLInputElement
461-
findField?.focus()
462-
findField?.select()
460+
requestAnimationFrame(() => {
461+
const findField = document.querySelector('[data-code-editor-find]') as HTMLInputElement
462+
findField?.focus()
463+
findField?.select()
464+
})
463465
}
464466

465467
const update = ({ transactions, docChanged, state, startState }: ViewUpdate) => {

0 commit comments

Comments
 (0)