Skip to content

Commit

Permalink
Don't stabilize the scroll position when the browser supports scroll …
Browse files Browse the repository at this point in the history
…anchoring

FIX: ProseMirror will no longer try to stabilize the scroll position
during updates on browsers that support [scroll
anchoring](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor),
since it'd inadvertently cancel the browser's behavior.

Issue ProseMirror/prosemirror#933
  • Loading branch information
marijnh committed May 28, 2019
1 parent 352d8d3 commit 1b0d582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -129,7 +129,7 @@ export class EditorView {
: state.scrollToSelection > prev.scrollToSelection ? "to selection" : "preserve"
let updateDoc = redraw || !this.docView.matchesNode(state.doc, outerDeco, innerDeco)
let updateSel = updateDoc || !state.selection.eq(prev.selection)
let oldScrollPos = scroll == "preserve" && updateSel && storeScrollPos(this)
let oldScrollPos = scroll == "preserve" && updateSel && this.dom.style.overflowAnchor == null && storeScrollPos(this)

if (updateSel) {
this.domObserver.stop()
Expand Down

0 comments on commit 1b0d582

Please sign in to comment.