diff --git a/services/web/frontend/js/features/source-editor/commands/ranges.ts b/services/web/frontend/js/features/source-editor/commands/ranges.ts index 5c5318c017..7bfa401e4d 100644 --- a/services/web/frontend/js/features/source-editor/commands/ranges.ts +++ b/services/web/frontend/js/features/source-editor/commands/ranges.ts @@ -67,7 +67,8 @@ export const wrapRanges = }, ], } - }) + }), + { scrollIntoView: true } ) return true } @@ -753,7 +754,8 @@ export function toggleRanges(command: string) { // Shouldn't happen, but default to just wrapping the content return wrapRangeInCommand(view.state, range, command) - }) + }), + { scrollIntoView: true } ) return true } diff --git a/services/web/frontend/js/features/source-editor/extensions/toolbar/lists.ts b/services/web/frontend/js/features/source-editor/extensions/toolbar/lists.ts index 7f848c3557..f1cd9e2986 100644 --- a/services/web/frontend/js/features/source-editor/extensions/toolbar/lists.ts +++ b/services/web/frontend/js/features/source-editor/extensions/toolbar/lists.ts @@ -87,7 +87,8 @@ const wrapRangesInList = view.dispatch( view.state.changeByRange(range => wrapRangeInList(view.state, range, environment) - ) + ), + { scrollIntoView: true } ) return true } @@ -182,7 +183,8 @@ const unwrapRangesFromList = view.dispatch( view.state.changeByRange(range => unwrapRangeFromList(view.state, range, environment) - ) + ), + { scrollIntoView: true } ) return true } @@ -306,7 +308,8 @@ export const toggleListForRanges = view.dispatch( view.state.changeByRange(range => toggleListForRange(view, range, environment) - ) + ), + { scrollIntoView: true } ) } diff --git a/services/web/frontend/js/features/source-editor/extensions/toolbar/sections.ts b/services/web/frontend/js/features/source-editor/extensions/toolbar/sections.ts index 54817f3aa4..140869c1e7 100644 --- a/services/web/frontend/js/features/source-editor/extensions/toolbar/sections.ts +++ b/services/web/frontend/js/features/source-editor/extensions/toolbar/sections.ts @@ -134,6 +134,7 @@ export const setSectionHeadingLevel = (view: EditorView, level: string) => { changes, } } - }) + }), + { scrollIntoView: true } ) }