Tobias Gritschacher has submitted this change and it was merged.

Change subject: (bug 45198) Do not hide entity selector's list of suggestion
......................................................................


(bug 45198) Do not hide entity selector's list of suggestion

The change set prevents the entity selector's list of suggestions from hiding
when an exact, unique label is typed into the input box.

Change-Id: I4e573d0578d3e153a842a20b4196fb7ed2b3b0f9
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Tobias Gritschacher: Verified; Looks good to me, approved



diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
index b2b8739..55cfd66 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
@@ -341,6 +341,18 @@
                },
 
                /**
+                * @see ui.suggester.close
+                */
+               close: function( event ) {
+                       if ( !event || !event.originalEvent || 
event.originalEvent.type !== 'programmatic' ) {
+                               // Do not close the list of suggestions when 
programmatically selecting an entity
+                               // (e.g by typing an exact, unique entity 
label), allowing the user to check that
+                               // the typed string actually matches a single 
entity.
+                               $.ui.suggester.prototype.close.apply( this, 
event );
+                       }
+               },
+
+               /**
                 * Triggers searching for more results with the current search 
term.
                 */
                more: function() {

-- 
To view, visit https://gerrit.wikimedia.org/r/51643
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4e573d0578d3e153a842a20b4196fb7ed2b3b0f9
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <henning.sna...@wikimedia.de>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to