@bigbinary/neeto-filters-frontend 2.12.8 → 2.12.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7020,13 +7020,16 @@ var Datetime = function Datetime(_ref) {
7020
7020
  });
7021
7021
  handleApplyFilter(updatedFilter);
7022
7022
  };
7023
+ useEffect(function () {
7024
+ isNil(filter) && setSelectedRule({});
7025
+ }, [filter]);
7023
7026
  return /*#__PURE__*/React.createElement("div", {
7024
7027
  className: "neeto-filters-pane-filter__item-wrapper"
7025
7028
  }, /*#__PURE__*/React.createElement(Select, {
7026
7029
  isClearable: true,
7027
7030
  autoFocus: autoFocus,
7028
- "data-cy": "neeto-filters-".concat(key, "-filter"),
7029
7031
  label: label,
7032
+ "data-cy": "neeto-filters-".concat(key, "-filter"),
7030
7033
  options: DATE_OPTIONS,
7031
7034
  strategy: "fixed",
7032
7035
  value: selectedRule,
@@ -7320,11 +7323,8 @@ var Text = function Text(_ref) {
7320
7323
 
7321
7324
  // Reset states when "Clear filters" button is clicked.
7322
7325
  useEffect(function () {
7323
- if (isEmpty(filters)) {
7324
- setInputValue("");
7325
- setSelectedRule(ruleOptions[0]);
7326
- }
7327
- }, [filters]);
7326
+ (isEmpty(filters) || isNil(filter)) && setInputValue("");
7327
+ }, [filters, filter]);
7328
7328
  useEffect(function () {
7329
7329
  if (!debouncedInputValue) {
7330
7330
  !isUndefinedOrEmpty(filter) && handleApplyFilter({