Mixin performance #875

Open
jsegarra wants to merge 11 commits from performance_mixins into dev
3 changed files with 2 additions and 16 deletions
Showing only changes of commit 4dc2be291f - Show all commits

View File

@ -25,8 +25,6 @@ export default {
const handleKeyUp = (event) => { const handleKeyUp = (event) => {
const { ctrlKey, altKey } = event; const { ctrlKey, altKey } = event;
// Resetea la bandera cuando se sueltan las teclas ctrl o alt
if (!ctrlKey || !altKey) { if (!ctrlKey || !altKey) {
isNotified = false; isNotified = false;
} }

View File

@ -9,38 +9,25 @@ export default {
const form = document.querySelector('.q-form#formModel'); const form = document.querySelector('.q-form#formModel');
if (!form) return; if (!form) return;
try { try {
// Login
const inputsFormCard = form.querySelectorAll( const inputsFormCard = form.querySelectorAll(
`input:not([disabled]):not([type="checkbox"])` `input:not([disabled]):not([type="checkbox"])`
); );
if (inputsFormCard.length) { if (inputsFormCard.length) {
// .focus();
// observerInstance.disconnect();
// return;
focusFirstInput(inputsFormCard[0]); focusFirstInput(inputsFormCard[0]);
} }
// VnNotes
const textareas = document.querySelectorAll( const textareas = document.querySelectorAll(
'textarea:not([disabled]), [contenteditable]:not([disabled])' 'textarea:not([disabled]), [contenteditable]:not([disabled])'
); );
if (textareas.length) { if (textareas.length) {
// textareas[textareas.length - 1].focus();
// observerInstance.disconnect();
// return;
focusFirstInput(textareas[textareas.length - 1]); focusFirstInput(textareas[textareas.length - 1]);
} }
// if (!inputs || inputs.length === 0) return;
const inputs = document.querySelectorAll( const inputs = document.querySelectorAll(
'form#formModel input:not([disabled]):not([type="checkbox"])' 'form#formModel input:not([disabled]):not([type="checkbox"])'
); );
const input = inputs[0]; const input = inputs[0];
if (!input) return; if (!input) return;
// if (input.type === 'textarea' || input.form) {
// AUTOFOCUS
focusFirstInput(input); focusFirstInput(input);
// input.focus();
// observerInstance.disconnect();
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
@ -61,5 +48,5 @@ export default {
that.onSubmit(); that.onSubmit();
} }
}); });
}, // mounted },
}; };

View File

@ -44,6 +44,7 @@ onMounted(async () => {
<template> <template>
<FetchData <FetchData
url="Countries" url="Countries"
:filter="countriesFilter"
auto-load auto-load
@on-fetch="(data) => (countriesOptions = data)" @on-fetch="(data) => (countriesOptions = data)"
/> />