Blank select listbox when re-opening in Firefox.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- react, typescript
- Ambito
- frontend, performance
Direzione di ricerca
Inizia con l’esempio riproducibile in src/App.tsx ed esegui l’esempio virtualizzato di Select in Firefox. Riproduci il problema scorrendo oltre il valore di overscan, chiudendo la listbox e riaprendola, quindi confronta il comportamento con Chrome. Il lavoro è completato quando le opzioni sono immediatamente visibili alla riapertura, senza dover scorrere.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 7.1k
- Fork
- 466
- Merge medio
- 2g 31m
- PR unite (30g)
- 13
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/virtual
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di TanStack/virtual
Issue simili
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Crush Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
ElementsProject/cln-application#167 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Quantco/pnpm-licenses#17 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100