People: Ignore route change event when tab is inactive #22

This commit is contained in:
Michael Mayer 2021-09-24 14:04:04 +02:00
parent e1d19f72f2
commit e707ca4786
3 changed files with 17 additions and 3 deletions

View file

@ -18,7 +18,7 @@
<v-tabs-items touchless>
<v-tab-item v-for="(item, index) in tabs" :key="index" lazy>
<component :is="item.component" :static-filter="item.filter"></component>
<component :is="item.component" :static-filter="item.filter" :active="active === index"></component>
</v-tab-item>
</v-tabs-items>
</v-tabs>

View file

@ -142,7 +142,8 @@ import {ClickLong, ClickShort, Input, InputInvalid} from "common/input";
export default {
name: 'PPageFaces',
props: {
staticFilter: Object
staticFilter: Object,
active: Boolean,
},
data() {
const query = this.$route.query;
@ -186,6 +187,12 @@ export default {
},
watch: {
'$route'() {
// Tab inactive?
if (!this.active) {
// Ignore event.
return;
}
const query = this.$route.query;
this.filter.q = query["q"] ? query["q"] : "";

View file

@ -159,7 +159,8 @@ import {ClickLong, ClickShort, Input, InputInvalid} from "common/input";
export default {
name: 'PPageSubjects',
props: {
staticFilter: Object
staticFilter: Object,
active: Boolean,
},
data() {
const query = this.$route.query;
@ -194,6 +195,12 @@ export default {
},
watch: {
'$route'() {
// Tab inactive?
if (!this.active) {
// Ignore event.
return;
}
const query = this.$route.query;
this.filter.q = query["q"] ? query["q"] : "";