@linzjs/lui 17.5.1 → 17.5.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [17.5.2](https://github.com/linz/lui/compare/v17.5.1...v17.5.2) (2022-06-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * clear search input after search type changed. ([#692](https://github.com/linz/lui/issues/692)) ([9c4138c](https://github.com/linz/lui/commit/9c4138c335b92788cb8e3420fdcc45a6d3f80658))
7
+
1
8
  ## [17.5.1](https://github.com/linz/lui/compare/v17.5.0...v17.5.1) (2022-06-01)
2
9
 
3
10
 
package/dist/index.js CHANGED
@@ -55910,6 +55910,10 @@ var LuiSearchInput = function (props) {
55910
55910
  var _e = React.useState(false), isLoading = _e[0], setIsLoading = _e[1];
55911
55911
  var inputRef = React.useRef(null);
55912
55912
  var selectedRef = React.useRef(null);
55913
+ //clear result after search types changed
55914
+ React.useEffect(function () {
55915
+ setResults([]);
55916
+ }, [props.getOptions]);
55913
55917
  function setInputValue(value) {
55914
55918
  setTypedValue(props.inputTransformer ? props.inputTransformer(value) : value);
55915
55919
  }
@@ -56048,6 +56052,7 @@ var LuiSearchInput = function (props) {
56048
56052
  props.name &&
56049
56053
  haveFocus &&
56050
56054
  results.length === 0 &&
56055
+ !isLoading &&
56051
56056
  noOptionsMessage(typedValue) && (React__default["default"].createElement(React__default["default"].Fragment, null,
56052
56057
  React__default["default"].createElement("hr", { className: "LuiSearchInput-resultSeparator" }),
56053
56058
  React__default["default"].createElement("div", { "data-testid": "no-result-msg", className: "LuiSearchInput-disclaimer" }, noOptionsMessage(typedValue)))),