Blank select listbox when re-opening in Firefox.
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- react, typescript
- Área
- frontend, performance
Línea de trabajo
Comienza con el ejemplo reproducible en src/App.tsx y ejecuta el ejemplo virtualizado de Select en Firefox. Reproduce el fallo desplazándote más allá del valor de overscan, cerrando el listbox y volviéndolo a abrir; después, compara el comportamiento con Chrome. Se considera terminado cuando las opciones son visibles inmediatamente al volver a abrirlo, sin necesidad de desplazarse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
If we reopen our Select listbox after scrolling down past the overscan value, the listbox has no options rendered. They appear in the DOM but not in the listbox. If you scroll even by 1px once reopened, the options render (I have attached a screen recording of this further down).
Your minimal, reproducible example
https://stackblitz.com/edit/parsium-carbon-starter-zza8bg?file=src%2FApp.tsx
Steps to reproduce
-
Open Firefox and navigate to our Select virtualised example or the reproducible Stackblitz example
-
Click the Select's component textbox to open it and scroll down beyond option 30 (the
overscanvalue is 20, so a whole new list of options is rendered there) -
Close the listbox. This can be done by clicking away from the listbox.
-
Click the Select's component textbox to reopen Select's listbox.
Actual Result:
Listbox is initially blank.
Expected Result:
Options to be visible.
Expected behavior
I expect there to be options in the listbox.
How often does this bug happen?
Every time
Screenshots or Videos
Firefox:
https://github.com/user-attachments/assets/6c2022b4-d56e-4bb0-925a-fbcfeb211839
Chrome:
https://github.com/user-attachments/assets/ed5d48c0-289c-42af-a84a-cc96de273fcb
Firefox but I scroll a small amount when reopening:
https://github.com/user-attachments/assets/6d7ba0f6-6540-4ac7-bb2a-3cc1ce763759
Platform
Operating Systems:
- MacOS
- Windows
Web Browser:
- Firefox (I am using v133.0)
tanstack-virtual version
v3.10.1
TypeScript version
v4.7.0
Additional context
I was able to fix this bug using the code below. However, I was not prepared to merge it into our codebase as I don't think browser sniffing is a particularly good fix for this. Without the conditional check for Firefox, this would break our implementation on Chrome, Safari and Edge.
This is what seemed to fix it:
const SCROLL_OPTIONS: ScrollToOptions = { behavior: "auto", align: "end" };
const browserIsFirefox =
navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
useEffect(() => {
if (browserIsFirefox && isOpen && currentOptionsListIndex === -1) {
virtualizer.scrollBy(0, SCROLL_OPTIONS);
}
});
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Lenguaje dominante
- TypeScript
- Estrellas
- 7.1k
- Forks
- 466
- Merge medio
- 2 d 31 min
- PR fusionados (30 d)
- 13
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/virtual
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Todos los issues de TanStack/virtual
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mksglu/context-mode#1200 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
anthropics/claude-code#96687 ·
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
AOSSIE-Org/DebateAI#582 · 2 comentarios ·