Merge "jquery.suggestions: Load initial suggestions only when focused"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 11 Jun 2019 20:22:38 +0000 (20:22 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 11 Jun 2019 20:22:38 +0000 (20:22 +0000)
resources/src/jquery/jquery.suggestions.js

index 26028e7..3083b0f 100644 (file)
                                        } );
                                // Load suggestions if the value is changed because there are already
                                // typed characters before the JavaScript is loaded.
-                               if ( this.value !== this.defaultValue ) {
+                               if ( $( this ).is( ':focus' ) && this.value !== this.defaultValue ) {
                                        update( context, false );
                                }
                        }