Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Blank select listbox when re-opening in Firefox.

Ouverte
#892 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
react, typescript

Piste de recherche

Commencez par l’exemple reproductible dans src/App.tsx et exécutez l’exemple virtualisé de Select dans Firefox. Reproduisez l’échec en faisant défiler au-delà de la valeur de overscan, en fermant la listbox, puis en la rouvrant, et comparez le comportement avec Chrome. C’est terminé lorsque les options sont immédiatement visibles à la réouverture, sans nécessiter de faire défiler.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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
  1. Open Firefox and navigate to our Select virtualised example or the reproducible Stackblitz example

  2. Click the Select's component textbox to open it and scroll down beyond option 30 (the overscan value is 20, so a whole new list of options is rendered there)

  3. Close the listbox. This can be done by clicking away from the listbox.

  4. 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.
Langage dominant
TypeScript
Étoiles
7.1k
Forks
466
Merge moyen
2 j 31 min
PR mergées (30 j)
13

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TanStack/virtual

Toutes les issues de TanStack/virtual

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.