Description
The limel-picker component renders selected values as chips via
limel-chip-set. Once #4026 lands, the chip-set will forward a per-chip
invalid flag through to the rendered limel-chip. The picker currently
has no way to opt into this — its internal createChip builds a chip from
a ListItem, and ListItem has no invalid field.
Motivation
A common use case is a multi-value picker where the selected values were
valid when chosen but are no longer valid — for example, a list of
assignees where one user has been deactivated, or a list of picked tags
where one has been archived. Today, the consumer can only mark the whole
picker as invalid, which is too coarse when only a subset of items is the
problem.
Proposed solution
- Add an optional
invalid?: boolean to the ListItem interface.
- Forward it in
limel-picker's createChip, so a ListItem with
invalid: true is rendered as an invalid chip.
This is independent of the picker's container-level invalid prop, which
continues to mark the whole field as invalid.
Depends on
#4026 — the chip-set must forward per-chip invalid to limel-chip
before this is useful end-to-end.
Description
The
limel-pickercomponent renders selected values as chips vialimel-chip-set. Once #4026 lands, the chip-set will forward a per-chipinvalidflag through to the renderedlimel-chip. The picker currentlyhas no way to opt into this — its internal
createChipbuilds a chip froma
ListItem, andListItemhas noinvalidfield.Motivation
A common use case is a multi-value picker where the selected values were
valid when chosen but are no longer valid — for example, a list of
assignees where one user has been deactivated, or a list of picked tags
where one has been archived. Today, the consumer can only mark the whole
picker as invalid, which is too coarse when only a subset of items is the
problem.
Proposed solution
invalid?: booleanto theListIteminterface.limel-picker'screateChip, so aListItemwithinvalid: trueis rendered as an invalid chip.This is independent of the picker's container-level
invalidprop, whichcontinues to mark the whole field as invalid.
Depends on
#4026 — the chip-set must forward per-chip
invalidtolimel-chipbefore this is useful end-to-end.