npm @elastic/react-search-ui 1.2.0
v1.2.0

latest releases: 1.22.0, 1.21.5, 1.21.4...
5 years ago

Version 1.2.0 adds a few helpful new features.

Features

Maintenance

Details

Initial Search

You can now enable alwaysSearchOnInitialLoad to performance a search when the page loads without a user having to submit the search form:

<SearchProvider
  config={{
    alwaysSearchOnInitialLoad: true
  }}
>

Batch actions and shouldClearFilters option

Batch actions allow you to call multiple actions in a row without incurring multiple API requests:

setSearchTerm("park");
addFilter("states", "Alaska", "any");
addFilter("states", "California", "any");

As part of this change, we've also added support for a shouldClearFilters flag, which lets you decide whether or not changing the current search term should clear out the current filter selections. The default previously was to always clear filters when the search term changes.

addFilter("states", "Alaska", "any");
addFilter("states", "California", "any");
setSearchTerm("park", { shouldClearFilters: false });
<SearchBoxContainer
  shouldClearFilters={false}
/>

Both of these features are helpful in a case where you have a search form with a submit button. Typically in search experiences, filters are applied immediately upon selection. But in the case of something like an "Advanced Search" form, filters are all applied at once only when a submit button is pressed. Being able to batch all actions at once on form submit makes this possible in Search UI.

See #391 for more detail.

BooleanFacet

Screenshot 2019-09-26 12 39 50

The BooleanFacet is a new view for Facet components to be used when you have simple boolean toggles. Imagine data fields on a restaurant search app... "Good for children", "Allows pets", "Open for dinner", etc.

Don't miss a new react-search-ui release

NewReleases is sending notifications on new releases.