+ /**
+ * @inheritdoc
+ */
+ mw.widgets.SearchInputWidget.prototype.onLookupMenuItemChoose = function ( item ) {
+ var items;
+
+ // get items which was suggested before the input changes
+ items = this.lookupMenu.items;
+
+ mw.widgets.SearchInputWidget.parent.prototype.onLookupMenuItemChoose.apply( this, arguments );
+
+ mw.track( 'mw.widgets.SearchInputWidget', {
+ action: 'click-result',
+ numberOfResults: items.length,
+ clickIndex: items.indexOf( item ) + 1
+ } );
+
+ if ( this.performSearchOnClick ) {
+ this.$element.closest( 'form' ).submit();
+ }
+ };
+