nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Problemas de scroll y enfoque en Selects y MultiSelects de HeroUI en vistas móviles

Open Moises-HP opened this issue 1 year ago • 6 comments

HeroUI Version

2.7.11

Describe the bug

Al utilizar componentes Select y MultiSelect de la librería HeroUI en formularios largos dentro de una aplicación React con TailwindCSS v3, se presenta un comportamiento errático al visualizar la app en modo móvil (tanto en dispositivos Android reales como en navegadores con modo responsive activado en escritorio).

Cuando un Select se encuentra en una posición inferior del formulario (es decir, no visible de inmediato al cargar), y el usuario hace scroll hacia él, al hacerle focus o intentar abrirlo:

El scroll de la página se reajusta automáticamente a una posición inesperada.

En algunos casos, el componente queda fuera de la pantalla visible.

El primer toque/click solamente reposiciona el scroll, y es necesario un segundo toque para abrir el Select.

En muchos casos, el componente se reposiciona mal y sigue sin poder abrirse, bloqueando la interacción.

Este comportamiento:

Solo ocurre en vista móvil (modo responsive del navegador o en celulares reales).

Se reproduce en Android (Chrome y otros navegadores), pero no en iOS (funciona correctamente en Safari y Chrome).

Es especialmente más notorio y problemático en el componente MultiSelect, donde el "salto" de scroll es aún mayor e inconsistente.

Importante: Para descartar cualquier configuración externa, se creó un proyecto limpio de React desde cero, instalando únicamente TailwindCSS v3 y HeroUI, sin layouts personalizados ni wrappers. El problema persiste en ese entorno básico.

Your Example Website or App

https://github.com/Moises-HP/HerouiBug.git

Steps to Reproduce the Bug or Issue

Create a new React project and install @heroui/react and tailwindcss.

Add a long form with multiple fields and include a Select or MultiSelect component from HeroUI near the bottom.

Ensure the form overflows vertically (so scrolling is required to reach the select).

Open the app in a mobile viewport, either:

Using Chrome DevTools responsive mode, or

On a physical Android device (Chrome or other browsers).

Scroll to the bottom of the form where the select is located.

Tap or click on the Select to interact with it.

Expected behavior

The select should open in place and not change the scroll position.

Screenshots or Videos

https://github.com/user-attachments/assets/792e02b9-b153-4414-9e76-7305845ca052

Operating System Version

macOS

Browser

Chrome

Moises-HP avatar Jul 01 '25 22:07 Moises-HP

Can reproduce it, and don't understand why isn't there a prop to disable this like shouldBlockScroll={false}.

wzrdx avatar Jul 02 '25 14:07 wzrdx

I used these two attributes as a temporary solution.

<Select
   maxListboxHeight={200}
   isVirtualized
/>

GreedyWhale avatar Nov 03 '25 03:11 GreedyWhale

Additionally, the Select component cannot add input fields to the Popover section. On mobile devices, clicking the input field automatically closes the Popover. The modal also has issues in Safari on iOS—whenever a form triggers the keyboard, the entire page layout becomes distorted. It seems this framework's popup components all have problems on mobile, forcing me to consider using alternative libraries instead.

GreedyWhale avatar Nov 03 '25 03:11 GreedyWhale

I have exacly the same problem with Select, and unfortunetley isVirtualized is not working for me

matios13 avatar Nov 20 '25 12:11 matios13

Closing in favor of v3. If the issue is reproducible in v3, please create a new one with a minimal reproducible example.

wingkwong avatar Apr 03 '26 13:04 wingkwong