Closed cHameleonRu closed 6 years ago
I'll add that I've tested this fix with Firefox, Chrome and Edge on Windows 10, plus Chrome and Firefox on Android, and auto-scrolling works fine on all of these.
Thanks for finding a solution!
But... I don't think this preserves the behaviour as it was meant to be: to scroll down but ensure the beginning of this turn's input is on screen. That said, I'm still open to merging this, however you'll need to edit src/structio/input.js instead, and rather than intercepting the call to scroll()
, please put the test inside that function.
Does anyone know why the current code doesn't work?
line: 163 "parchment/src/structio/input.js"
self.scrollParent = /webkit/i.test( navigator.userAgent ) ? $body : $( 'html' );
If "self.scroolParent = $body", then "this.scrollParent.scrollTop()" always is 0. For Chrome need "$( 'html' )", but Microsoft Edge need "$body".
Auto-scrolling for Chrome (fix issue https://github.com/curiousdannii/parchment/issues/50)