<Magnify class="global-search__trigger" :size="22" />
</template>
</NcButton>
- <GlobalSearchModal :is-visible="showGlobalSearch" :class="'global-search-modal'" />
+ <GlobalSearchModal :class="'global-search-modal'" :is-visible="showGlobalSearch" @update:isVisible="handleModalVisibilityChange" />
</div>
</template>
toggleGlobalSearch() {
this.showGlobalSearch = !this.showGlobalSearch
},
+ handleModalVisibilityChange(newVisibilityVal) {
+ this.showGlobalSearch = newVisibilityVal
+ },
},
}
</script>
<NcModal id="global-search"
ref="globalSearchModal"
:name="t('core', 'Global search')"
- :show.sync="isVisible"
+ :show.sync="internalIsVisible"
:clear-view-delay="0"
:title="t('Global search')"
@close="closeModal">
contacts: [],
debouncedFind: debounce(this.find, 300),
showDateRangeModal: false,
+ internalIsVisible: false,
}
},
},
watch: {
isVisible(value) {
+ this.internalIsVisible = value
+ },
+ internalIsVisible(value) {
+ this.$emit('update:isVisible', value)
this.$nextTick(() => {
if (value) {
this.focusInput()
}
})
},
+
},
mounted() {
getProviders().then((providers) => {
this.$refs.searchInput.$el.children[0].children[0].focus()
},
closeModal() {
- this.$refs.globalSearchModal.close()
+ this.internalIsVisible = false
this.searchQuery = ''
},
supportFiltering() {