diff --git a/vue/src/apps/PropertyEditorView/PropertyEditorView.vue b/vue/src/apps/PropertyEditorView/PropertyEditorView.vue
index f7fa5d90..ea416ee6 100644
--- a/vue/src/apps/PropertyEditorView/PropertyEditorView.vue
+++ b/vue/src/apps/PropertyEditorView/PropertyEditorView.vue
@@ -69,10 +69,11 @@
- Add
+ Add
-
+
|
@@ -248,7 +249,8 @@ export default {
updateFood: function (food) {
let apiClient = new ApiApiFactory()
apiClient.partialUpdateFood(food.id, food).then(result => {
- this.spliceInFood(this.buildFood(result.data))
+ // don't use result to prevent flickering
+ //this.spliceInFood(this.buildFood(result.data))
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
}).catch((err) => {
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
@@ -269,10 +271,12 @@ export default {
copyCalculatedResult: function () {
this.$copyText(this.calculator_to_amount)
},
- enableProperty: function (property, food) {
+ enableProperty: async function (property, food) {
property.property_amount = 0;
this.updateFood(food)
- document.getElementById(`id_add_btn_${food.id}_${property.property_type.id}`).focus()
+ await this.$nextTick();
+ this.$refs[`id_input_${food.id}_${property.property_type.id}`][0].focus()
+ this.$refs[`id_input_${food.id}_${property.property_type.id}`][0].select()
},
},
}