docs(react): update listbox docs demos - #349
Conversation
|
Reopening: Nitin (@49-22) can you post a reproduction? I was unable to reproduce this. If the test reproduction is only possible with |
|
Yes, it’s reproducible only when Listbox.content is not mounted initially yet how about keeping an example to ensure even an uninformed AI agent or dev can avoid wasting time in debugging it. |
dea9920 to
a7095cb
Compare
mounts Signed-off-by: Nitin <nitin.nagamalla@gmail.com>
Signed-off-by: Nitin <nitin.nagamalla@gmail.com>
a7095cb to
928c7f0
Compare
|
Ryan Bower (@R-Bower) Updated the examples to ensure what I missed is not missed by anyone else. |
| {loading ? ( | ||
| <div className="text-muted-foreground px-3 py-2 text-sm"> | ||
| Loading regions... | ||
| </div> | ||
| ) : collection.items.length === 0 ? ( | ||
| <div className="text-muted-foreground px-3 py-2 text-sm"> | ||
| No regions found | ||
| </div> | ||
| ) : ( |
There was a problem hiding this comment.
This is not valid HTML. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/listbox_role
Listboxes contain children whose role is option or elements whose role is group which in turn contain children whose role is option.
There was a problem hiding this comment.
Listbox.Content has role="listbox"

Summary
className="max-h-64 overflow-y-auto".Listbox.Contentmounted while loading, empty, and loaded states render inside it.Context
Reviewer feedback clarified that
Listbox.Contentis expected to always remain mounted, even when no options are available. This PR no longer changes core Listbox keyboard behavior for an initially unmounted content case. Instead, it documents the intended async-data pattern in the React docs.Testing