Skip to content

picker: expose invalid state per list item #4028

@TommyLindh2

Description

@TommyLindh2

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

  1. Add an optional invalid?: boolean to the ListItem interface.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions