From 937352a1383191eb7cd18c73d6a33887e8398bd6 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Wed, 20 Oct 2021 16:39:43 +0200 Subject: [PATCH] Don't try to focus a removed template parameter The event "focusTemplateParameterById" targets the right side of the dialog. The input field for the parameter should be focussed. This doesn't make any sense when the parameter was just removed (i.e. unselected). Change-Id: Ie75b1edaebe9d0444b98e66cb56a5c7774393bea --- .../ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js index 89cfd9c2e9..50bb3efde6 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js @@ -188,7 +188,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onTemplateParameterChoose = this.onTemplateParameterSelectionChanged( item, selected ); var param = this.templateModel.getParameter( item.getData() ); - if ( param ) { + if ( param && selected ) { this.emit( 'focusTemplateParameterById', param.getId() ); } };