Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-03 21:08:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-03 21:08:29 +0300
commit592223823c8ebf6e32d98e4b12620ba8ff043cca (patch)
tree1c665b754b1487df374d9cb28cfc61ff40a6b317 /app/assets/javascripts/milestones
parent0e13b2c71563d578805fc01fda9a4361f9f9d053 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/milestones')
-rw-r--r--app/assets/javascripts/milestones/project_milestone_combobox.vue10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/milestones/project_milestone_combobox.vue b/app/assets/javascripts/milestones/project_milestone_combobox.vue
index b2196bd9ceb..1a94cf2a465 100644
--- a/app/assets/javascripts/milestones/project_milestone_combobox.vue
+++ b/app/assets/javascripts/milestones/project_milestone_combobox.vue
@@ -13,6 +13,8 @@ import { __, sprintf } from '~/locale';
import Api from '~/api';
import { deprecatedCreateFlash as createFlash } from '~/flash';
+const SEARCH_DEBOUNCE_MS = 250;
+
export default {
components: {
GlNewDropdown,
@@ -95,12 +97,15 @@ export default {
// lodash attaches to the function, which is
// made inaccessible by Vue. More info:
// https://stackoverflow.com/a/52988020/1063392
- this.debouncedSearchMilestones = debounce(this.searchMilestones, 100);
+ this.debouncedSearchMilestones = debounce(this.searchMilestones, SEARCH_DEBOUNCE_MS);
},
mounted() {
this.fetchMilestones();
},
methods: {
+ focusSearchBox() {
+ this.$refs.searchBox.$el.querySelector('input').focus();
+ },
fetchMilestones() {
this.requestCount += 1;
@@ -183,7 +188,7 @@ export default {
</script>
<template>
- <gl-new-dropdown>
+ <gl-new-dropdown v-bind="$attrs" class="project-milestone-combobox" @shown="focusSearchBox">
<template slot="button-content">
<span ref="buttonText" class="flex-grow-1 ml-1 text-muted">{{
selectedMilestonesLabel
@@ -198,6 +203,7 @@ export default {
<gl-new-dropdown-divider />
<gl-search-box-by-type
+ ref="searchBox"
v-model.trim="searchQuery"
class="gl-m-3"
:placeholder="this.$options.translations.searchMilestones"