Fix broken scroll on sidebar toggle

This was using the currentPage from the StackLayout. It will not
be updated there anymore.

Also removing the line about focus after toggle. We do not want
that anymore afaik.

Bug: T312015
Bug: T289043
Change-Id: I8b6eedd580d49604014118171c6da62849752d53
This commit is contained in:
WMDE-Fisch 2022-07-04 16:00:39 +02:00
parent 90a5f8aaad
commit ed4fa49520

View file

@ -361,8 +361,7 @@ ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar )
}, OO.ui.theme.getDialogTransitionDuration() );
// Reapply selection and scrolling when switching between panes.
// FIXME: decouple from descendants
var selectedPage = this.bookletLayout.stackLayout.getCurrentItem();
var selectedPage = this.bookletLayout.getCurrentPage();
if ( selectedPage ) {
var name = selectedPage.getName();
// Align whichever panel is becoming visible, after animation completes.
@ -371,9 +370,7 @@ ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar )
if ( expandSidebar ) {
dialog.sidebar.setSelectionByPageName( name );
} else {
selectedPage.scrollElementIntoView();
// TODO: Find a reliable way to refocus.
// dialog.bookletLayout.focusPart( name );
selectedPage.scrollElementIntoView( { alignToTop: true, padding: { top: 20 } } );
}
}, OO.ui.theme.getDialogTransitionDuration() );
}