From 2aa309b62ca3e2ae0fb8ddc99acefb43060c27c9 Mon Sep 17 00:00:00 2001 From: Anton Reshetov Date: Mon, 30 Mar 2020 07:09:57 +0300 Subject: [PATCH] fix: twice selected snippet name when add a new #85 --- src/renderer/components/snippets/SnippetView.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/snippets/SnippetView.vue b/src/renderer/components/snippets/SnippetView.vue index 99937b4..55fbf86 100644 --- a/src/renderer/components/snippets/SnippetView.vue +++ b/src/renderer/components/snippets/SnippetView.vue @@ -172,11 +172,13 @@ export default { }, watch: { - isNew () { - this.$nextTick(() => { - this.$refs.input.$refs.input.focus() - this.$refs.input.$refs.input.select() - }) + isNew (v) { + if (v) { + this.$nextTick(() => { + this.$refs.input.$refs.input.focus() + this.$refs.input.$refs.input.select() + }) + } } },