0
0
Fork 0

perf: improve handleKeyUp method

This commit is contained in:
Javier Segarra 2024-06-06 07:50:24 +00:00
parent 0ad839dfc6
commit 26c7b09b8a
1 changed files with 2 additions and 4 deletions

View File

@ -21,11 +21,9 @@ const currentUser = ref(state.getUser());
const newNote = ref('');
const vnPaginateRef = ref();
function handleKeyUp(event) {
if (event.key === 'Enter' && event.shiftKey) {
event.preventDefault();
} else if (event.key === 'Enter') {
insert();
if (event.key === 'Enter') {
event.preventDefault();
if (!event.shiftKey) insert();
}
}
async function insert() {