mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #13477 from overleaf/ae-bottom-padding
[cm6] Improve bottom padding calculations GitOrigin-RevId: 91fff97ebf6675cddffdd89118fd06f003321143
This commit is contained in:
+8
-11
@@ -334,20 +334,17 @@ export const createChangeManager = (
|
||||
}
|
||||
|
||||
case 'sizes': {
|
||||
const { overflowTop, height } = payload
|
||||
const padding = view.documentPadding
|
||||
const contentHeight =
|
||||
view.contentDOM.clientHeight - padding.top - padding.bottom
|
||||
const paddingNeeded = height - contentHeight
|
||||
|
||||
if (
|
||||
overflowTop !== editorVerticalTopPadding(view) ||
|
||||
paddingNeeded !== padding.bottom
|
||||
) {
|
||||
// the content height and top overflow of the review panel
|
||||
const { height, overflowTop } = payload
|
||||
// the difference between the review panel height and the editor content height
|
||||
const heightDiff = height + overflowTop - view.contentDOM.clientHeight
|
||||
// the height of the block added at the top of the editor to match the review panel
|
||||
const topPadding = editorVerticalTopPadding(view)
|
||||
if (overflowTop !== topPadding || heightDiff !== 0) {
|
||||
view.dispatch(
|
||||
setVerticalOverflow({
|
||||
top: overflowTop,
|
||||
bottom: paddingNeeded,
|
||||
bottom: heightDiff + view.documentPadding.bottom,
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user