[BUG] dcc.Dropdown: virtualized list keeps the height measured at opening when options grow while the menu is open
Mantenedores costumam responder em até 1 dia
@KoolADE85 já está trabalhando nisso.
Desde 9/11/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Describe your context
dash 4.5.0
Reproduced in headless Chromium (Playwright); first seen by our users on dash 4.4.1.
Describe the bug
A multi dcc.Dropdown whose options are updated by a callback while its menu is open keeps the list height it measured when the menu opened. If the menu opens while the options are few (here 1) and the callback then brings back many (here 300), the virtualized list stays one row tall (34 px) and the user has to scroll inside a single row. Closing and opening the menu again shows it at the normal height.
This happens with cascading filters: an item is chosen, the callback narrows the options to it, the user clears it with the × and opens the menu again before the callback has returned all the options.
The cause seems to be in OptionsList (components/dash-core-components/src/utils/optionRendering.tsx): the container is measured once, in a useLayoutEffect with an empty dependency array, and listHeight = Math.min(measuredHeight, options.length * defaultOptionHeight). With one option the measured height is one row, and it is never measured again when options grows.
Minimal example
import time
from dash import Dash, Input, Output, dcc, html
ALL = [f"item-{i:03d}" for i in range(300)]
app = Dash(__name__)
app.layout = html.Div(
[dcc.Dropdown(id="dd", options=ALL, multi=True, placeholder="Pick an item")],
style={"width": 400, "padding": 40},
)
@app.callback(Output("dd", "options"), Input("dd", "value"))
def narrow(value):
# like a cascading filter: once an item is chosen only it is offered;
# cleared, all 300 come back (the server takes a moment)
time.sleep(0.5)
return value if value else ALL
if __name__ == "__main__":
app.run(port=8077, debug=False)
Steps:
- open the menu, pick
item-007, close the menu (the options become["item-007"]); - click the × (Clear selection) and open the menu at once, before the callback returns;
- wait for the 300 options to come back.
Measured with Playwright on .dash-dropdown-content .dash-options-list-virtualized:
| State | list height | content height |
|---|---|---|
| menu opened with 300 options | 124 px | 10494 px |
| step 3: menu opened with 1 option, 300 options back | 34 px | 10500 px |
| menu closed and opened again | 124 px | 10494 px |
Expected behavior
The list height follows the options: when options changes while the menu is open, the list is measured again (for example the layout effect depending on options.length, or measuredHeight reset when the options change), so 300 options show at the normal height without closing and reopening the menu.
We work around it client-side by closing and reopening a menu whose virtualized list is shorter than three rows while its content is taller, which is what users did by hand.
- Linguagem predominante
- Python
- Estrelas
- 24.5k
- Forks
- 2.3k
- Merge médio
- 3d 7h
- PRs com merge (30d)
- 30
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de plotly/dash
-
P2 plotly-internal size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Extract graph schema validation into properly named testTalvez já em andamento @Nice6042 assumiu há 90 dias. Abertagood first issue P3 size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
plotly/dash#3735 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
[BUG] Patch.update mutates a shared mapping and rewrites earlier mergesTalvez já em andamento @peterolkhov assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
[BUG] `set_props` streamingTalvez já em andamento @BSd3v assumiu há 5 dias. Abertabug P3 size: 1
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
plotly/dash#4127 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[BUG] dcc.Upload contents and dcc.Geolocation position docstrings describe the wrong value formatTalvez já em andamento @ZainnQureshii assumiu há 5 dias. Abertabug P3 size: 1
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 30/100
Mantenedores costumam responder em até 1 dia
Todas as issues de plotly/dash
Issues semelhantes
-
[BUG] HTTP lifecycle dispatch treats a NO_PROXY-only environment as corporate egress and skips the resolve-and-pinned sessionTalvez já em andamento @bodapatisaikrishna assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
[integration]: NoMacSandboxAbertaexternal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
langchain-ai/docs#7652 ·
Mantenedores costumam responder em até 1 dia
-
[oblt-aw][autodoc] Document new e2e-secret-leak-artifacts workflow and update e2e-all leaf listAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
elastic/oblt-aw#2513 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug p2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
amd/gaia#7326 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
NCAR/CLM-Tutorial#113 · 1 comentário ·
Mantenedores costumam responder em até 1 dia