Skip to content

Commit 9e3e301

Browse files
committed
feat(snippets): exit from edit mode by enter for fragment
1 parent d890083 commit 9e3e301

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/renderer/components/snippets/SnippetsFragmentsInput.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
class="fragment"
44
@dblclick="isEdit = true"
55
@contextmenu="onClickContext"
6+
@keypress="onKyePress"
67
>
78
<div
89
v-if="!isEdit"
@@ -78,6 +79,10 @@ const onClickContext = async () => {
7879
}
7980
}
8081
82+
const onKyePress = (e: KeyboardEvent) => {
83+
if (e.code === 'Enter') isEdit.value = false
84+
}
85+
8186
watch(isEdit, () => {
8287
nextTick(() => inputRef.value?.select())
8388
})

0 commit comments

Comments
 (0)