Skip to content

Add onValueSelected prop for search components #254

Description

@divyanshu013

Issue Type:

Enhancement

Description:

Add a new prop onValueSelected to search components DataSearch and CategorySearch. This will accept a function which will be invoked with the current value when the selected value of the component changes (user presses enter or selects a suggestion or clicks outside). In case of autosuggest set to false this behaves like onValueChange.

This prop will eliminate the need of having an extra component watching the search component with react prop. This also solves a use case of only using the search component for suggestions and displaying the results in a different page with the help of URLParams.

Update - We can also extend the CategorySearch by passing the selected category along with the value to this function. A very interesting and useful usecase is using this category to set the value of a different component, say MultiList as in the Car Store example app.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions