Skip to content

SelectPanel multiple variant does not support dynamic labels #3824

@myabc

Description

@myabc

SelectPanel multiple variant does not support dynamic labels

Note

Primer's React implementation allows for this behavior by customizing the Button passed in as renderAnchor:

<FormControl>
      <FormControl.Label>Labels</FormControl.Label>
      <SelectPanel title="Select labels" placeholder="Select labels" subtitle="Use labels to organize issues and pull requests" renderAnchor={({
      children,
      ...anchorProps
    }) => <Button trailingAction={TriangleDownIcon} {...anchorProps} aria-haspopup="dialog">
            {children}
          </Button>} open={open} onOpenChange={setOpen} items={filteredItems} selected={selected} onSelectedChange={setSelected} onFilterChange={setFilter} width="medium" message={filteredItems.length === 0 ? NoResultsMessage(filter) : undefined} />
    </FormControl>

(example taken from Primer React Storybook)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions