Fetches facets on taginput filter after clicking on them.

This commit is contained in:
mateuswetah 2024-05-16 16:29:21 -03:00
parent 195a122291
commit 0b022a7c08
3 changed files with 15 additions and 8 deletions

View File

@ -5,6 +5,7 @@
size="is-small"
:data="options"
autocomplete
:open-on-focus="true"
expanded
:loading="isLoadingOptions"
:remove-on-keys="[]"
@ -16,6 +17,7 @@
check-infinite-scroll
@update:model-value="($event) => { resetPage(); onSelect($event) }"
@typing="search"
@focus="($event) => { searchQuery = $event.target.value; performSearch(searchQuery) }"
@infinite-scroll="searchMore">
<template #default="props">
<div class="media">
@ -96,8 +98,7 @@
this.updateSelectedValues();
},
methods: {
search: _.debounce( function(query) {
performSearch(query) {
// String update
if (query != this.searchQuery) {
this.searchQuery = query;
@ -154,7 +155,9 @@
// Search Request Token for cancelling
this.getOptionsValuesCancel = promise.source;
},
search: _.debounce( function(query) {
this.performSearch(query);
}, 500),
searchMore: _.debounce(function () {
this.search(this.searchQuery);

View File

@ -5,6 +5,7 @@
icon="magnify"
:data="options"
autocomplete
:open-on-focus="true"
:loading="isLoadingOptions"
expanded
:remove-on-keys="[]"
@ -16,6 +17,7 @@
:placeholder="$i18n.get('info_type_to_add_terms')"
check-infinite-scroll
@typing="search"
@focus="($event) => { searchQuery = $event.target.value; performSearch(searchQuery) }"
@update:model-value="($event) => { resetPage(); onSelect($event) }"
@infinite-scroll="searchMore">
<template #default="props">
@ -88,8 +90,7 @@
this.updateSelectedValues();
},
methods: {
search: _.debounce( function(query) {
performSearch(query) {
// String update
if (query != this.searchQuery) {
this.searchQuery = query;
@ -166,9 +167,12 @@
this.isLoadingOptions = false;
this.$console.log(error);
});
},
search: _.debounce( function(query) {
this.performSearch(query);
}, 500),
searchMore: _.debounce(function () {
this.search(this.searchQuery)
this.performSearch(this.searchQuery)
}, 250),
updateSelectedValues() {

View File

@ -285,7 +285,7 @@ export const dynamicFilterTypeMixin = {
if (this.options.length < this.maxNumOptionsCheckboxList && !search)
this.noMorePage = 1;
if (this.filter.max_options && this.options.length >= this.filter.max_options) {
if ((this.filterTypeOptions.use_max_options == true && this.filter.max_options) && this.options.length >= this.filter.max_options) {
let showViewAllButton = true;
if (this.options.length === this.filter.max_options){
@ -358,7 +358,7 @@ export const dynamicFilterTypeMixin = {
if (this.options.length < this.maxNumOptionsCheckboxList)
this.noMorePage = 1;
if (this.filter.max_options && this.options.length >= this.filter.max_options) {
if ((this.filterTypeOptions.use_max_options == true && this.filter.max_options) && this.options.length >= this.filter.max_options) {
let showViewAllButton = true;
if(this.options.length === this.filter.max_options){