diff --git a/resources/views/chat-publico.blade.php b/resources/views/chat-publico.blade.php index 542554b..9f5273e 100644 --- a/resources/views/chat-publico.blade.php +++ b/resources/views/chat-publico.blade.php @@ -109,17 +109,20 @@ const root = document.getElementById('chat-root'); if (!root || !window.visualViewport) return; - const isMobile = window.innerWidth < 640; - if (!isMobile) return; // En desktop no necesitamos ajustar - const update = () => { - root.style.height = window.visualViewport.height + 'px'; + const vh = window.visualViewport.height; + // En móvil: ajustamos #chat-root a la altura visual real + if (window.innerWidth < 640) { + root.style.height = vh + 'px'; + } + // Scroll al fondo siempre que cambie el viewport const msgs = document.getElementById('pub-messages'); - if (msgs) setTimeout(() => { msgs.scrollTop = msgs.scrollHeight; }, 50); + if (msgs) { + requestAnimationFrame(() => { msgs.scrollTop = msgs.scrollHeight; }); + } }; window.visualViewport.addEventListener('resize', update); - window.visualViewport.addEventListener('scroll', update); update(); } diff --git a/resources/views/livewire/chat/public-chat.blade.php b/resources/views/livewire/chat/public-chat.blade.php index b681c4a..e327a65 100644 --- a/resources/views/livewire/chat/public-chat.blade.php +++ b/resources/views/livewire/chat/public-chat.blade.php @@ -154,7 +154,7 @@ {{-- ══ PASO 3: Interfaz de chat ══ --}} @else -
+ style="overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;"> @forelse($mensajes as $msg) @@ -452,7 +452,7 @@ {{-- Input + upload --}} @if ($estadoConv !== 'cerrada') -
+
{{-- Indicador de procesando imagen --}} @if ($procesandoImagen)