Don't set a ParameterPage as next selection after delete

This can only happen when deleting the last part of a transclusion,
then we want to set the previous page as selected. This should never
be a parameter though.

Bug: T312221
Change-Id: I06700dcf37f6d4f7dd073f8f2bc1b8b0a17a62c4
This commit is contained in:
WMDE-Fisch 2022-07-12 13:35:34 +02:00
parent ec522938b8
commit 5067a1e216

View file

@ -299,9 +299,10 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.removePages = function ( pages
isCurrentPageRemoved = true;
}
} else {
if ( !isCurrentPageRemoved ) {
// avoid choosing a parameter as previous selection
if ( !isCurrentPageRemoved && pageName.indexOf( '/' ) === -1 ) {
prevSelectionCandidate = pageName;
} else if ( !nextSelectionCandidate ) {
} else if ( isCurrentPageRemoved && !nextSelectionCandidate ) {
nextSelectionCandidate = pageName;
}
}