From 9885709f897246f9b8e5fb48f4576a9adf22006b Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Tue, 6 Dec 2022 15:36:06 +0300 Subject: [PATCH] console error fixed --- resources/assets/js/views/common/documents.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/views/common/documents.js b/resources/assets/js/views/common/documents.js index bf0f3452c..cb77d4739 100644 --- a/resources/assets/js/views/common/documents.js +++ b/resources/assets/js/views/common/documents.js @@ -114,7 +114,10 @@ const app = new Vue({ onRefFocus(ref) { let index = this.form.items.length - 1; - this.$refs['items-' + index + '-' + ref][0].focus(); + if (this.$refs['items-' + index + '-' + ref] != undefined) { + let first_ref = this.$refs['items-' + index + '-' + ref]; + first_ref != undefined ? first_ref[0].focus() : this.$refs[Object.keys(this.$refs)[0]][0].focus(); + } }, onCalculateTotal() {