Skip to content

SelectMultiple - adding additional options within onSearch #7074

@jcfilben

Description

@jcfilben

Expected Behavior

When I search within SelectMultiple I should be able to use my search term to query a backend to fetch more options that were not available already in the options array.

Actual Behavior

The internal allOptions prop doesn't get updated to reflect the new options. SelectMultiple is currently built in a way that onSearch can't change options to something that isn't a subset of the previous options.

URL, screen shot, or Codepen exhibiting the issue

https://codesandbox.io/p/sandbox/grommet-v2-template-forked-ht9y6h?file=%2Findex.js%3A16%2C34

Steps to Reproduce

In the above codesandbox example search for 'cd', notice new options were added but the new options can not be selected

Your Environment

  • Grommet version: 2.34.2
  • Browser Name and version:
  • Operating System and version (desktop or mobile):

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA suggestion to add to or change behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions