Skip to content

Commit 0e0b029

Browse files
committed
Fix active filter count
1 parent b1fc5fe commit 0e0b029

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

dist/js/filter.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/filter.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mix-manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"/js/filter.js": "/js/filter.js?id=780ee916c0da40342cfb",
2+
"/js/filter.js": "/js/filter.js?id=600ccbe8010e2133d28d",
33
"/css/filter.css": "/css/filter.css?id=f3ba983b895c4611d7b4",
4-
"/js/filter.js.map": "/js/filter.js.map?id=4fc538b5467629854790",
4+
"/js/filter.js.map": "/js/filter.js.map?id=e696de49cbed576fcbba",
55
"/css/filter.css.map": "/css/filter.css.map?id=3a7186ee9f42604ffbf2"
66
}

resources/js/components/DateRangeFilter.vue

+7-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/>
3232

3333
<button
34-
v-show="this.filter.currentValue"
34+
v-show="isValidCurrentValue"
3535
class="reset-button btn btn-sm fa fa-times"
3636
@click="resetFilter"
3737
></button>
@@ -74,7 +74,7 @@
7474
7575
this.$store.commit(`${this.resourceName}/updateFilterState`, {
7676
filterClass: this.filterKey,
77-
value: Array.isArray(value) && value.length === 2 ? value : '',
77+
value: Array.isArray(value) && value.length === 2 ? value : [],
7878
});
7979
8080
this.$emit('change');
@@ -84,7 +84,7 @@
8484
const flatpickrConfig = this.$refs.dateRangePickerComponent.getFlatpickrConfig();
8585
const rangeSeparator = flatpickrConfig.locale.rangeSeparator || 'to';
8686
87-
if (!Array.isArray(this.filter.currentValue) || this.filter.currentValue.length !== 2) {
87+
if (!this.isValidCurrentValue) {
8888
return;
8989
}
9090
@@ -93,6 +93,10 @@
9393
.join(` ${rangeSeparator} `);
9494
},
9595
96+
isValidCurrentValue: function () {
97+
return Array.isArray(this.filter.currentValue) && this.filter.currentValue.length === 2
98+
},
99+
96100
resetFilter: function () {
97101
this.$refs.dateRangePickerComponent.clear();
98102
},

0 commit comments

Comments
 (0)