Realtime Preview: scroll to cursor when opening/closing RTP

Bug: T311684
Follow-Up: I377fb3a122cda360e016716e3beb9c34983b8e10
Change-Id: Ic5c56f71589c944b15b83b49362fc250cb337c46
This commit is contained in:
MusikAnimal 2022-07-25 21:05:53 -04:00
parent 4d02fb808b
commit 770277689a

View file

@ -202,6 +202,7 @@ RealtimePreview.prototype.toggle = function ( saveUserPref ) {
// Restore current selection.
$textarea.textSelection( 'setSelection', { start: cursorPos[ 0 ], end: cursorPos[ 1 ] } );
$textarea.textSelection( 'scrollToCaretPosition' );
// Focus on whatever had focus before, in case it wasn't the textarea.
focusedElement.focus();