summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/components/branches
diff options
context:
space:
mode:
authorHimanshu Kapoor <hkapoor@gitlab.com>2019-08-09 12:31:54 +0530
committerHimanshu Kapoor <hkapoor@gitlab.com>2019-08-09 12:44:42 +0530
commit8470c131fa1eaacdf5a2278b69e79939fe761dcc (patch)
tree4b22db76d754864952a6d69e4a5614efb947a9c0 /app/assets/javascripts/ide/components/branches
parentf6a201a8389895b1f3dbc510f82372cce72c4611 (diff)
downloadgitlab-ce-8470c131fa1eaacdf5a2278b69e79939fe761dcc.tar.gz
Focus on the input when clicked outside the input
Fixed in MR list and branch list components. Earlier clicking right outside the input box closed the dropdown, which was unexpected behaviour. To make it consistent with the behaviour of select2 jquery plugin, I have made clicking outside the input focus on the input by using a label.
Diffstat (limited to 'app/assets/javascripts/ide/components/branches')
-rw-r--r--app/assets/javascripts/ide/components/branches/search_list.vue24
1 files changed, 11 insertions, 13 deletions
diff --git a/app/assets/javascripts/ide/components/branches/search_list.vue b/app/assets/javascripts/ide/components/branches/search_list.vue
index 3cfdc1a367a..5e82d1150a0 100644
--- a/app/assets/javascripts/ide/components/branches/search_list.vue
+++ b/app/assets/javascripts/ide/components/branches/search_list.vue
@@ -58,19 +58,17 @@ export default {
<template>
<div>
- <div class="dropdown-input mt-3 pb-3 mb-0 border-bottom">
- <div class="position-relative">
- <input
- ref="searchInput"
- v-model="search"
- :placeholder="__('Search branches')"
- type="search"
- class="form-control dropdown-input-field"
- @input="searchBranches"
- />
- <icon :size="18" name="search" class="input-icon" />
- </div>
- </div>
+ <label class="dropdown-input pt-3 pb-3 mb-0 border-bottom block position-relative" @click.stop>
+ <input
+ ref="searchInput"
+ v-model="search"
+ :placeholder="__('Search branches')"
+ type="search"
+ class="form-control dropdown-input-field"
+ @input="searchBranches"
+ />
+ <icon :size="18" name="search" class="input-icon" />
+ </label>
<div class="dropdown-content ide-merge-requests-dropdown-content d-flex">
<gl-loading-icon
v-if="isLoading"