aboutsummaryrefslogtreecommitdiffstats
path: root/resources/src/jquery/jquery.suggestions.js
diff options
context:
space:
mode:
authorFomafix <fomafix@googlemail.com>2019-05-14 21:46:39 +0200
committerFomafix <fomafix@googlemail.com>2019-05-16 20:27:54 +0200
commit72f61f7a5930cf03d4e8ddde62c2ef627b05dd69 (patch)
tree4295409507313d123dd2b9dbe424f74243e104f6 /resources/src/jquery/jquery.suggestions.js
parent25fbc13d651afb9c281669a51981807de6a84083 (diff)
downloadmediawikicore-72f61f7a5930cf03d4e8ddde62c2ef627b05dd69.tar.gz
mediawikicore-72f61f7a5930cf03d4e8ddde62c2ef627b05dd69.zip
jquery.suggestions: Trigger keypress on initializing
The keypress event triggers a search suggestion window when there are already typed characters in the search field while loading the JavaScript. Bug: T223422 Change-Id: I2bd79722ab20cde268fdb43338096c792b95ea28
Diffstat (limited to 'resources/src/jquery/jquery.suggestions.js')
-rw-r--r--resources/src/jquery/jquery.suggestions.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/resources/src/jquery/jquery.suggestions.js b/resources/src/jquery/jquery.suggestions.js
index a585cf384e3b..9e6ecc888d18 100644
--- a/resources/src/jquery/jquery.suggestions.js
+++ b/resources/src/jquery/jquery.suggestions.js
@@ -776,7 +776,10 @@
}
$.suggestions.hide( context );
$.suggestions.cancel( context );
- } );
+ } )
+ // Simulate a keypress on load. This loads the search suggestions when there are already
+ // typed characters before the JavaScript is loaded.
+ .trigger( 'keypress' );
}
// Store the context for next time