From 96da6cedfe21fe9a299cfbd717ff77690cdc05f3 Mon Sep 17 00:00:00 2001 From: thiemowmde Date: Thu, 22 Feb 2024 18:58:01 +0100 Subject: [PATCH] Use OOUI's native "unselect all" feature No need to manually scan for the currently selected item. And no need to do it twice. The feature is a little hidden (calling the method with no parameter) but always was supported. Bug: T356871 Change-Id: I02401284eef5687eb0825d8d9ae0df294b3b4e03 --- modules/ve-cite/ve.ui.MWReferenceSearchWidget.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js b/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js index f5f23a755..feb437725 100644 --- a/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js +++ b/modules/ve-cite/ve.ui.MWReferenceSearchWidget.js @@ -60,9 +60,7 @@ ve.ui.MWReferenceSearchWidget.prototype.onQueryChange = function () { * @param {ve.dm.InternalList} internalList Internal list */ ve.ui.MWReferenceSearchWidget.prototype.setInternalList = function ( internalList ) { - if ( this.results.findSelectedItem() ) { - this.results.findSelectedItem().setSelected( false ); - } + this.results.unselectItem(); this.internalList = internalList; this.internalList.connect( this, { update: 'onInternalListUpdate' } );