mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
[cm6] Add offset to review panel entry positions when needed (#13912)
* Add offset to review panel entry positions when needed * Fix useResizeObserver usage GitOrigin-RevId: e220ce94e13c3a2347fc72654de747356eb1e658
This commit is contained in:
+7
-1
@@ -10,6 +10,12 @@ import { EditorView, ViewUpdate } from '@codemirror/view'
|
||||
import { CurrentDoc } from '../../../../../../types/current-doc'
|
||||
import { fullHeightCoordsAtPos } from '../../utils/layer'
|
||||
import { debounce } from 'lodash'
|
||||
import getMeta from '../../../../utils/meta'
|
||||
|
||||
// If a toolbar row sits alongside the review panel, the review panel entries need to be shifted down by 32px.
|
||||
// Once the review panel is always inside the editor, this offset can be removed.
|
||||
const offsetTop =
|
||||
getMeta('ol-showSourceToolbar') && !getMeta('ol-isReviewPanelReact') ? 32 : 0
|
||||
|
||||
// With less than this number of entries, don't bother culling to avoid
|
||||
// little UI jumps when scrolling.
|
||||
@@ -79,7 +85,7 @@ export const createChangeManager = (
|
||||
visibilityChanged = true
|
||||
}
|
||||
|
||||
entry.screenPos = { y, height, editorPaddingTop }
|
||||
entry.screenPos = { y: y + offsetTop, height, editorPaddingTop }
|
||||
}
|
||||
|
||||
if (allVisible) {
|
||||
|
||||
Reference in New Issue
Block a user