mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
[cm6] Use a block widget for padding at the top of the editor (#12705)
GitOrigin-RevId: 000ce9c90ea6b2ca72ab969704354a19fcea7a87
This commit is contained in:
+5
-2
@@ -342,7 +342,10 @@ export const createChangeManager = (
|
||||
view.contentDOM.clientHeight - padding.top - padding.bottom
|
||||
const paddingNeeded = height - contentHeight
|
||||
|
||||
if (overflowTop !== padding.top || paddingNeeded !== padding.bottom) {
|
||||
if (
|
||||
overflowTop !== editorVerticalTopPadding(view) ||
|
||||
paddingNeeded !== padding.bottom
|
||||
) {
|
||||
view.dispatch(
|
||||
setVerticalOverflow({
|
||||
top: overflowTop,
|
||||
@@ -456,7 +459,7 @@ export const createChangeManager = (
|
||||
(update.geometryChanged || update.viewportChanged) &&
|
||||
Date.now() < ignoreGeometryChangesUntil
|
||||
) {
|
||||
// Ignore a change to the editor geometry that occurs immediately after
|
||||
// Ignore a change to the editor geometry or viewport that occurs immediately after
|
||||
// an update to the vertical padding because otherwise it triggers
|
||||
// another update to the padding and so on ad infinitum. This is not an
|
||||
// ideal way to handle this but I couldn't see another way.
|
||||
|
||||
Reference in New Issue
Block a user