mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 18:20:09 +02:00
Wrap dispatchSelectionAndScroll in setTimeout (#22596)
GitOrigin-RevId: 8c2c27acdbbf0e8879978e307ccf952c1be5381e
This commit is contained in:
@@ -122,12 +122,13 @@ const dispatchSelectionAndScroll = (
|
||||
view: EditorView,
|
||||
selection: SelectionRange
|
||||
) => {
|
||||
view.dispatch({
|
||||
selection,
|
||||
effects: EditorView.scrollIntoView(selection, { y: 'center' }),
|
||||
window.setTimeout(() => {
|
||||
view.dispatch({
|
||||
selection,
|
||||
effects: EditorView.scrollIntoView(selection, { y: 'center' }),
|
||||
})
|
||||
view.focus()
|
||||
})
|
||||
|
||||
view.focus()
|
||||
}
|
||||
|
||||
export const setCursorLineAndScroll = (
|
||||
|
||||
Reference in New Issue
Block a user