[cm6] Use a block widget for padding at the top of the editor (#12705)

GitOrigin-RevId: 000ce9c90ea6b2ca72ab969704354a19fcea7a87
This commit is contained in:
Alf Eaton
2023-04-25 08:04:53 +00:00
committed by Copybot
parent b063495200
commit acf6abb0fb
4 changed files with 65 additions and 24 deletions
@@ -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.