From 442aea2bbe562fc6cde62155c73f4a04b46d843d Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Tue, 13 Jun 2023 14:27:32 +0200 Subject: [PATCH] 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 --- .../client/ui/properties/PropertyForm.vue | 2 ++ .../client/ui/properties/forms/ActionForm.vue | 2 +- .../ui/properties/forms/AdjustmentForm.vue | 8 +------ .../ui/properties/forms/AttributeForm.vue | 2 +- .../client/ui/properties/forms/BranchForm.vue | 2 +- .../client/ui/properties/forms/BuffForm.vue | 2 +- .../ui/properties/forms/BuffRemoverForm.vue | 2 +- .../client/ui/properties/forms/ClassForm.vue | 2 +- .../ui/properties/forms/ClassLevelForm.vue | 1 + .../ui/properties/forms/ConstantForm.vue | 1 + .../ui/properties/forms/ContainerForm.vue | 5 ++++- .../client/ui/properties/forms/DamageForm.vue | 2 +- .../properties/forms/DamageMultiplierForm.vue | 2 +- .../client/ui/properties/forms/EffectForm.vue | 1 + .../ui/properties/forms/FeatureForm.vue | 1 + .../client/ui/properties/forms/FolderForm.vue | 2 +- .../client/ui/properties/forms/ItemForm.vue | 2 +- .../client/ui/properties/forms/NoteForm.vue | 1 + .../ui/properties/forms/PointBuyForm.vue | 2 +- .../ui/properties/forms/ProficiencyForm.vue | 1 + .../ui/properties/forms/ReferenceForm.vue | 1 + .../client/ui/properties/forms/RollForm.vue | 2 +- .../ui/properties/forms/SavingThrowForm.vue | 2 +- .../client/ui/properties/forms/SkillForm.vue | 2 +- .../ui/properties/forms/SlotFillerForm.vue | 1 + .../client/ui/properties/forms/SlotForm.vue | 9 +------- .../client/ui/properties/forms/SpellForm.vue | 2 +- .../ui/properties/forms/SpellListForm.vue | 1 + .../client/ui/properties/forms/ToggleForm.vue | 2 +- .../ui/properties/forms/TriggerForm.vue | 2 +- .../properties/forms/shared/FormSections.vue | 21 ++++++++++++++++++- app/imports/client/ui/vuexStore.js | 9 +++++++- 32 files changed, 62 insertions(+), 35 deletions(-) diff --git a/app/imports/client/ui/properties/PropertyForm.vue b/app/imports/client/ui/properties/PropertyForm.vue index 003a1fbc..473e49ab 100644 --- a/app/imports/client/ui/properties/PropertyForm.vue +++ b/app/imports/client/ui/properties/PropertyForm.vue @@ -283,6 +283,7 @@ export default { } }, mounted() { + /** Disable auto-focus, it gets in the way more than it helps // Don't autofocus on mobile, it brings up the on-screen keyboard if (this.$vuetify.breakpoint.smAndDown) return; @@ -291,6 +292,7 @@ export default { this.$refs.focusFirst.focus() } }, 300); + */ }, methods: { selectSubProperty(_id){ diff --git a/app/imports/client/ui/properties/forms/ActionForm.vue b/app/imports/client/ui/properties/forms/ActionForm.vue index 1b89930e..218f0c03 100644 --- a/app/imports/client/ui/properties/forms/ActionForm.vue +++ b/app/imports/client/ui/properties/forms/ActionForm.vue @@ -93,7 +93,7 @@ $emit('change', {path: ['description', ...path], value, ack})" /> - + - + - - - diff --git a/app/imports/client/ui/properties/forms/AttributeForm.vue b/app/imports/client/ui/properties/forms/AttributeForm.vue index 02f53aaa..32072b95 100644 --- a/app/imports/client/ui/properties/forms/AttributeForm.vue +++ b/app/imports/client/ui/properties/forms/AttributeForm.vue @@ -74,7 +74,7 @@ @change="({path, value, ack}) => $emit('change', {path: ['description', ...path], value, ack})" /> - + - + - + - + - + diff --git a/app/imports/client/ui/properties/forms/ConstantForm.vue b/app/imports/client/ui/properties/forms/ConstantForm.vue index 297ff737..316688bd 100644 --- a/app/imports/client/ui/properties/forms/ConstantForm.vue +++ b/app/imports/client/ui/properties/forms/ConstantForm.vue @@ -24,6 +24,7 @@ diff --git a/app/imports/client/ui/properties/forms/ContainerForm.vue b/app/imports/client/ui/properties/forms/ContainerForm.vue index 71e4ccec..9d8556f3 100644 --- a/app/imports/client/ui/properties/forms/ContainerForm.vue +++ b/app/imports/client/ui/properties/forms/ContainerForm.vue @@ -71,7 +71,10 @@ $emit('change', {path: ['description', ...path], value, ack})" /> - + diff --git a/app/imports/client/ui/properties/forms/DamageForm.vue b/app/imports/client/ui/properties/forms/DamageForm.vue index bf7682af..b7ed8881 100644 --- a/app/imports/client/ui/properties/forms/DamageForm.vue +++ b/app/imports/client/ui/properties/forms/DamageForm.vue @@ -42,7 +42,7 @@ :error-messages="errors.target" @change="change('target', ...arguments)" /> - + - + diff --git a/app/imports/client/ui/properties/forms/FeatureForm.vue b/app/imports/client/ui/properties/forms/FeatureForm.vue index fbde4df8..acf86e2c 100644 --- a/app/imports/client/ui/properties/forms/FeatureForm.vue +++ b/app/imports/client/ui/properties/forms/FeatureForm.vue @@ -21,6 +21,7 @@ diff --git a/app/imports/client/ui/properties/forms/FolderForm.vue b/app/imports/client/ui/properties/forms/FolderForm.vue index 0d4e0825..3baab232 100644 --- a/app/imports/client/ui/properties/forms/FolderForm.vue +++ b/app/imports/client/ui/properties/forms/FolderForm.vue @@ -1,7 +1,7 @@