Fixed Editor contents scrolled out of sight when focusing editor with lots of text

Steffen

Well-known member
Affected version
2.0.9
At least in Chrome for Android (I haven't tested this in other browsers but our users say that it affects Firefox for Android, too) there is the following issue: When focusing an editor with lots of text (such that it doesn't auto-expand anymore, like here) the editor contents are scrolled out of sight.

I've made a video because it's difficult to explain. Look what happens at timestamp 0:00:18 where I tap the first line of the editor contents: the editor contents automatically scroll away. The result is that the position at which I placed the cursor isn't in the visible viewport anymore.

(I had to heavily compress the video to make it fit into the 2 MB upload limit in this forum, please excuse the bad quality. :))
 

Attachments

Last edited:
(I had to heavily compress the video to make it fit into the 2 MB upload limit in this forum, please excuse the bad quality. :))
Incidentally, the max upload limit is supposed to be a lot higher than that. This may not have been adjusted on the new server setup.
 
As far as I can tell at this point, this isn't directly a Froala issue and it may be related to something we do specifically after focusing the editor. I seem to only be able to reproduce something similar when using it in XF.
 
And, on that basis, I think I found the problematic code. In editor.js we call a function on focus: scrollToCursorAfterPendingResize.
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.2).

Change log:
When focusing the editor with an Android device, ensure that the contents are correctly scrolled into view.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom