Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8388-fineTunningInvoiceIn
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-04-28 16:57:27 +02:00
commit bf79797024
1 changed files with 4 additions and 3 deletions

View File

@ -218,7 +218,7 @@ onBeforeMount(() => {
}); });
onMounted(async () => { onMounted(async () => {
if ($props.isEditable) document.addEventListener('click', clickHandler); if ($props.isEditable) document.addEventListener('mousedown', mousedownHandler);
mode.value = mode.value =
quasar.platform.is.mobile && !$props.disableOption?.card quasar.platform.is.mobile && !$props.disableOption?.card
? CARD_MODE ? CARD_MODE
@ -241,7 +241,7 @@ onMounted(async () => {
}); });
onUnmounted(async () => { onUnmounted(async () => {
if ($props.isEditable) document.removeEventListener('click', clickHandler); if ($props.isEditable) document.removeEventListener('mousedown', mousedownHandler);
}); });
watch( watch(
@ -389,7 +389,7 @@ function hasEditableFormat(column) {
if (isEditableColumn(column)) return 'editable-text'; if (isEditableColumn(column)) return 'editable-text';
} }
const clickHandler = async (event) => { const mousedownHandler = async (event) => {
const clickedElement = event.target.closest('td'); const clickedElement = event.target.closest('td');
const isDateElement = event.target.closest('.q-date'); const isDateElement = event.target.closest('.q-date');
const isTimeElement = event.target.closest('.q-time'); const isTimeElement = event.target.closest('.q-time');
@ -412,6 +412,7 @@ const clickHandler = async (event) => {
} }
if (isEditableColumn(column)) { if (isEditableColumn(column)) {
event.preventDefault();
await renderInput(Number(rowIndex), colField, clickedElement); await renderInput(Number(rowIndex), colField, clickedElement);
} }
}; };