Fix: Auto-Refresh in Vertragsdokumente ueberschreibt keine Formulareingaben mehr

This commit is contained in:
Giuseppe Lombardo 2026-08-13 16:35:18 +00:00
parent 29ebb2e6b7
commit 53834cc509

View File

@ -3048,6 +3048,13 @@
const contractUploadFiles = {}; // contractId -> ausgewählte, noch nicht hochgeladene Files const contractUploadFiles = {}; // contractId -> ausgewählte, noch nicht hochgeladene Files
async function loadContractDocuments() { async function loadContractDocuments() {
// Während der Nutzer in einem der Vertragsformulare tippt, darf der
// periodische Auto-Refresh die Eingaben nicht überschreiben (sonst
// werden Formularfelder nach REFRESH_INTERVAL_MS scheinbar "automatisch
// geleert"). Solange der Fokus innerhalb der Liste liegt, wird der
// Refresh daher übersprungen.
const list = document.getElementById('contractDocumentsList');
if (list && list.contains(document.activeElement)) return;
try { try {
const data = await apiFetch('/contracts/documents'); const data = await apiFetch('/contracts/documents');
renderContractDocuments(data.contracts); renderContractDocuments(data.contracts);