Skip to content

Commit

Permalink
Add a scroll event handler that refreshes the view on scroll.
Browse files Browse the repository at this point in the history
This seems to be a bug in CodeMirror 6.  When scrolling down in a long
document, eventually the text is invisible until you click inside the
editor window.  This event handler refreshes the view on scroll so that
doesn't happen.
  • Loading branch information
drgrice1 committed Oct 7, 2024
1 parent 2ab6da1 commit 1d9b347
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openwebwork/pg-codemirror-editor",
"version": "0.0.1-beta.1",
"version": "0.0.1-beta.2",
"description": "PG CodeMirror Editor",
"author": "The WeBWorK Project",
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions src/pg-codemirror-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ export class View {
...completionKeymap,
indentWithTab
]),
EditorView.domEventHandlers({
scroll: () => {
this.refresh('scroll-update');
}
}),
this.theme.of(lightTheme),
this.language.of([])
];
Expand Down

0 comments on commit 1d9b347

Please sign in to comment.