MultiSelector: add showTooltip to list the selected options on the trigger

Aperta
#159 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ironAiken2 ci sta già lavorando.

Dal 10/11/2026.

  • #162 di @ironAiken2 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Start at the ui-common MultiSelector wrapper and inspect how it uses useMergedValue, resolves option labels, merges refs, and forwards onOpenChange; then check the existing Tooltip API. Add the opt-in trigger tooltip under the conditions in the proposal, and verify it lists all selected labels while staying closed for an open listbox, disabled state, and renderTrigger.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

When a MultiSelector trigger has more selections than it shows, the rest collapse into +N (after three labels in triggerDisplay="labels", after maxBadges badges in "badges"), and long labels are cut off by the ellipsis. The user cannot tell which options are selected without opening the listbox.

Astryx MultiSelector offers no hook for this: +N is fixed text, formatValue returns a string and is not called for "badges", and renderTrigger replaces the whole field. Consumers who wrap the selector in their own Tooltip have to track the selection, merge refs, and keep the tooltip shut while the listbox is open.

Proposal

Add an opt-in showTooltip?: boolean prop to ui-common MultiSelector. When it is set and at least one option is selected, a ui-common Tooltip anchored to the trigger (anchorRef) lists every selected label, comma-separated.

  • The selection comes from the wrapper's existing useMergedValue, so controlled and uncontrolled use both work.
  • Labels are resolved from options (including section options), falling back to the value.
  • The consumer's ref is merged with the anchor ref.
  • The tooltip is held shut while the listbox is open (onOpenChange is still forwarded).
  • No tooltip when disabled, so it does not compete with Astryx's disabledMessage tooltip, and none with renderTrigger, whose control the caller owns.

The default stays off, so existing call sites are unchanged.

Context

lablup/backend.ai-webui#10955 built this inside a product wrapper; that PR is on hold until this lands, after which the wrapper goes back to a plain re-export (lablup/backend.ai-webui#10986).

Lingua principale
TypeScript
Stelle
2
Fork
0
Merge medio
21h 38m
PR unite (30g)
38

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lablup/ui-common

Tutte le issue di lablup/ui-common

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.