From 986fe8fd9317b8af619b7666659cb772371c0804 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 5 Jun 2020 22:39:21 +0200 Subject: [PATCH] Added an autofocus field to most forms --- app/imports/ui/components/global/SmartInputMixin.js | 3 +++ app/imports/ui/components/global/TextField.vue | 1 + app/imports/ui/properties/forms/ActionForm.vue | 1 + app/imports/ui/properties/forms/AttributeForm.vue | 1 + app/imports/ui/properties/forms/BuffForm.vue | 1 + app/imports/ui/properties/forms/ClassLevelForm.vue | 1 + app/imports/ui/properties/forms/ContainerForm.vue | 1 + app/imports/ui/properties/forms/DamageForm.vue | 1 + app/imports/ui/properties/forms/DamageMultiplierForm.vue | 1 + app/imports/ui/properties/forms/EffectForm.vue | 1 + app/imports/ui/properties/forms/FeatureForm.vue | 1 + app/imports/ui/properties/forms/FolderForm.vue | 1 + app/imports/ui/properties/forms/ItemForm.vue | 1 + app/imports/ui/properties/forms/NoteForm.vue | 1 + app/imports/ui/properties/forms/ProficiencyForm.vue | 1 + app/imports/ui/properties/forms/RollForm.vue | 1 + app/imports/ui/properties/forms/SavingThrowForm.vue | 1 + app/imports/ui/properties/forms/SkillForm.vue | 1 + app/imports/ui/properties/forms/SpellForm.vue | 1 + app/imports/ui/properties/forms/SpellListForm.vue | 1 + app/imports/ui/properties/forms/ToggleForm.vue | 1 + .../ui/properties/forms/shared/propertyFormMixin.js | 7 ++++++- 22 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/imports/ui/components/global/SmartInputMixin.js b/app/imports/ui/components/global/SmartInputMixin.js index b39b0c5f..266e4029 100644 --- a/app/imports/ui/components/global/SmartInputMixin.js +++ b/app/imports/ui/components/global/SmartInputMixin.js @@ -93,6 +93,9 @@ export default { this.safeValue = null; this.$nextTick(() => this.safeValue = this.value); }, + focus(){ + this.$refs.input.focus(); + } }, computed: { errors(){ diff --git a/app/imports/ui/components/global/TextField.vue b/app/imports/ui/components/global/TextField.vue index f7fab2f9..5f8b79c3 100644 --- a/app/imports/ui/components/global/TextField.vue +++ b/app/imports/ui/components/global/TextField.vue @@ -1,5 +1,6 @@