mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[cm6] Add scrollIntoView when commands are dispatched (#11678)
GitOrigin-RevId: be005885330b9b29c7ddbfeacaec0a41d96e5e25
This commit is contained in:
parent
7d237d0103
commit
63b2064420
3 changed files with 12 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -134,6 +134,7 @@ export const setSectionHeadingLevel = (view: EditorView, level: string) => {
|
|||
changes,
|
||||
}
|
||||
}
|
||||
})
|
||||
}),
|
||||
{ scrollIntoView: true }
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue