Hi,
The visible area is not updated after the scroll.
I need to click on the last line, and then the visible dom is updated.
Please see the attached video. After scrolling, you will see the empty space. After clicking on the last line, the visible area is updated. This behavior is not observed when scrolling with selection.
const cmdTheme = EditorView.theme({
"&": {
color: "white",
backgroundColor: "black",
minWidth: '50em',
minHeight: '15em',
maxHeight: '15em',
},
".cm-scroller": { overflow: "auto" }
}, { dark: true })
const cmdState = EditorState.create({
doc: defaultCmdText,
extensions: [
cmdTheme,
EditorView.editable.of(false),
EditorView.lineWrapping,
]
})
const cmd = useRef<EditorView | null>(null);
const cmdContainerRef = useRef(null);
useEffect(() => {
cmd.current = new EditorView({
state: cmdState,
parent: cmdContainerRef.current || undefined,
});
return () => {
cmd.current?.destroy();
}
}, []);
<div ref={cmdContainerRef} />