From ecc582177ca1d0e57cddcd2297d39ef62cd02319 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 17 Jul 2026 18:28:59 -0500 Subject: [PATCH] fix(toma-progresiva): no hacer scroll al abrir si no hay ninguna firma iniciada Co-Authored-By: Claude Sonnet 4.6 --- ver_formulario_enviado.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 9ce3d9b..5431c65 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -1906,6 +1906,9 @@ function _mpRefreshCards(signedFid, nextFid) { document.addEventListener('DOMContentLoaded', function() { _mpRenderCards(); setTimeout(function() { + var hayFirmaIniciada = Object.keys(window._mpSavedFirmas || {}).length > 0 + || !!document.querySelector('.firma-box img'); + if (!hayFirmaIniciada) return; var fw = document.querySelector('.firma-pro-widget:not([style*="display:none"])'); if (fw) { fw.scrollIntoView({ behavior: 'smooth', block: 'start' }); @@ -2589,7 +2592,10 @@ const topaz = (() => { // Toma progresiva: scroll a la primera firma pendiente if (window._muestrasMap) { setTimeout(function() { - var fw = document.querySelector('.firma-pro-widget:not([style*="display:none"])'); + var hayFirmaIniciada = Object.keys(window._mpSavedFirmas || {}).length > 0 + || !!document.querySelector('.firma-box img'); + var fw = hayFirmaIniciada + ? document.querySelector('.firma-pro-widget:not([style*="display:none"])') : null; if (fw) { fw.scrollIntoView({ behavior: 'smooth', block: 'start' }); } else if (evt) {