diff --git a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js index 6e2abe0cc6..6cc5178843 100644 --- a/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js +++ b/modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js @@ -307,10 +307,8 @@ ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.removePages = function ( pages } ); this.stackLayout.removeItems( pagesToRemove ); - if ( isCurrentPageRemoved ) { - this.setPage( isCurrentParameter ? null : - nextSelectionCandidate || prevSelectionCandidate - ); + if ( isCurrentPageRemoved && !isCurrentParameter ) { + this.setPage( nextSelectionCandidate || prevSelectionCandidate ); } }; diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterSelectWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterSelectWidget.js index acce5eeaeb..f44980a44d 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterSelectWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterSelectWidget.js @@ -148,6 +148,12 @@ ve.ui.MWTransclusionOutlineParameterSelectWidget.prototype.markParameterAsUnused var item = paramName ? this.findItemFromData( paramName ) : null; if ( item ) { item.setSelected( false ); + paramName = paramName || null; + // An unused parameter can't be the active (set) one; it doesn't exist in the content pane + if ( this.itemSet === paramName ) { + this.itemSet = null; + item.setParameter( false ); + } } };