fix: large content scroll bug in codemirror editor (#4138)

This commit is contained in:
Nivedin
2024-06-21 23:27:22 +05:30
committed by GitHub
parent 292d752f32
commit 257974325e
3 changed files with 8 additions and 4 deletions

View File

@@ -330,7 +330,10 @@ export function useCodemirror(
),
EditorView.domEventHandlers({
scroll(event) {
scroll(event, view) {
// HACK: This is a workaround to fix the issue in CodeMirror where the content doesn't load when the editor is not in view.
view.requestMeasure()
if (event.target && options.contextMenuEnabled) {
// Debounce to make the performance better
debouncedTextSelection(30)()