Fixes unexpected disappearing of tag after it addition in taginput of advanced search

This commit is contained in:
weryques 2018-09-06 12:48:56 -03:00
parent f31ea4a711
commit cf7b10eff3
1 changed files with 14 additions and 2 deletions

View File

@ -1,9 +1,15 @@
<template> <template>
<div> <div>
<section <section
style="position: relative;"
v-if="!metadata || metadata.length <= 0" v-if="!metadata || metadata.length <= 0"
class="field is-grouped-centered section"> class="field is-grouped-centered section">
<div class="content has-text-gray has-text-centered"> <b-loading
:is-full-page="false"
:active.sync="metadataIsLoading"/>
<div
v-if="!metadataIsLoading"
class="content has-text-gray has-text-centered">
<p> <p>
<b-icon <b-icon
icon="format-list-checks" icon="format-list-checks"
@ -35,7 +41,6 @@
:class="{'is-3': isHeader}" :class="{'is-3': isHeader}"
class="column"> class="column">
<b-select <b-select
:loading="metadataIsLoading"
:placeholder="$i18n.get('instruction_select_a_metadatum')" :placeholder="$i18n.get('instruction_select_a_metadatum')"
:disabled="advancedSearchQuery.taxquery[searchCriterion] || :disabled="advancedSearchQuery.taxquery[searchCriterion] ||
advancedSearchQuery.metaquery[searchCriterion] ? true : false" advancedSearchQuery.metaquery[searchCriterion] ? true : false"
@ -347,6 +352,10 @@
'fetchMetadata' 'fetchMetadata'
]), ]),
autoCompleteTerm: _.debounce( function(value, searchCriterion){ autoCompleteTerm: _.debounce( function(value, searchCriterion){
if(!value){
return;
}
this.termList = []; this.termList = [];
this.terms = []; this.terms = [];
this.$set(this.advancedSearchQuery.taxquery[searchCriterion], 'isFetching', 1); this.$set(this.advancedSearchQuery.taxquery[searchCriterion], 'isFetching', 1);
@ -545,6 +554,9 @@
} }
}, },
addToAdvancedSearchQuery(value, type, searchCriterion){ addToAdvancedSearchQuery(value, type, searchCriterion){
if(!value){
return;
}
if(type == 'metadatum'){ if(type == 'metadatum'){
const criteriaKey = value.split('-'); const criteriaKey = value.split('-');