You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am adding text to the editor by the click of a button, but the newly added text is not visible because the editor does not automatically scroll.
Is there either a flag that I can set so that new content is detected and the scroll happens automatically, or is there a way via JavaScript to manually scroll to the bottom?
Thank you.
The text was updated successfully, but these errors were encountered:
The editor should really do this so marking as a bug.
For now it can be done getting the documentElement from the body node and setting the scrollTop property.
Something like this should work:
constdocument=instance.getBody().ownerDocument;constdocumentElement=document.documentElement;// Save selection so can see where end marker isinstance.getRangeHelper().saveRange();constmarker=document.getElementById('sceditor-end-marker');marker.style.display='inline-block';// Work out where end marker is and current scroll positionconstscrollTop=documentElement.scrollTop;constscrollTo=(sceditor.dom.getOffset(marker).top+(marker.offsetHeight*1.5))-documentElement.offsetHeight;marker.style.display='none';// Only scroll if end marker isn't already visibleif(scrollTo>scrollTop||scrollTo+documentElement.offsetHeight<scrollTop){documentElement.scrollTop=scrollTo;}// Restore selectioninstance.getRangeHelper().restoreRange();
I am adding text to the editor by the click of a button, but the newly added text is not visible because the editor does not automatically scroll.
Is there either a flag that I can set so that new content is detected and the scroll happens automatically, or is there a way via JavaScript to manually scroll to the bottom?
Thank you.
The text was updated successfully, but these errors were encountered: