From 57c87fa40b20ed639a64aa9c8e3242eb47b95256 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Tue, 25 Aug 2020 22:33:10 +0200 Subject: [PATCH] :bug: (transaction) try to fix focus on validating --- src/components/TransactionCreate.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/components/TransactionCreate.vue b/src/components/TransactionCreate.vue index 74f02c0..7a6cf5d 100644 --- a/src/components/TransactionCreate.vue +++ b/src/components/TransactionCreate.vue @@ -432,6 +432,21 @@ export default class TransactionCreate extends Vue { } private validate(): boolean { + const activeElement = document.activeElement + if (activeElement) { + const input = activeElement as HTMLInputElement + if (input.blur) { + input.blur() + } + } + + const el = document.querySelector(':focus') + if (el) { + const input = el as HTMLInputElement + if (input.blur) { + input.blur() + } + } if ( !this.name || !this.amount ||