Edit: This seems to be tangentially related to https://github.com/ProseMirror/prosemirror/issues/933. I applied the same workaround addressed in the issue: setting overflow-anchor: none. This fixed the problem, though I don’t understand why the patch in the aforementioned issue doesn’t work in this case. I must be doing something weird.
I’m experiencing a strange scrolling issue once documents get to be of a certain length. If the scroll is at the top portion of the scrollbar, this doesn’t occur, but once I scroll down a certain amount, every call to (prosemirror-model) updateState causes the scroll to jump downwards.
I’ve been banging my head against this for a couple of days now. I actually changed the padding on the container that’s holding the prosemirror editorview instance and that stopped the jumping at least temporarily, but later I found it had returned. I also played with some of the handleScroll props on EditorView, but I didn’t really have a good idea what I was trying to accomplish there.
Any tips on what to investigate next?
dispatchTransaction = tx => {
// In case EditorView makes any modification to a state we funnel those
// modifications up to the parent and apply to the EditorView itself.
const { state, transactions } = this.props.editorState.applyTransaction(tx);
if (this._editorView != null) {
this._editorView.updateState(state);
}
if (this.props.onChange) {
this.cancelInProgress();
if (transactions.some(tr => tr.docChanged)) {
this.props.onChange(state, null, true);
} else {
this.inProgressChange = setTimeout(
() => this.props.onChange(state, null, false),
IN_PROGRESS_DEBOUNCE_INTERVAL
);
}
}
};
componentWillReceiveProps(nextProps) {
// In case we receive new EditorState through props — we apply it to the
// EditorView instance.
if (this._editorView) {
if (nextProps.editorState !== this.props.editorState) {
this._editorView.updateState(nextProps.editorState);
}
}
}