Forms try to hold your place better

Expanding form sections keeps them expanded when
changing property viewed or opening a new prop
Disabled auto-focus, because it forces scroll
This commit is contained in:
Stefan Zermatten
2023-06-13 14:27:32 +02:00
parent 1fe7ed8972
commit 442aea2bbe
32 changed files with 62 additions and 35 deletions

View File

@@ -1,5 +1,6 @@
<template lang="html">
<v-expansion-panels
v-model="expand"
accordion
tile
multiple
@@ -10,5 +11,23 @@
</template>
<script lang="js">
export default {}
export default {
props: {
type: {
type: String,
default: undefined,
}
},
data() {
return {
expand: this.$store.getters.formExpansionByType(this.type),
};
},
watch: {
expand(value) {
if (!this.type) return;
this.$store.commit('setFormExpansion', {type: this.type, value});
}
}
}
</script>