ublo-lib 1.47.22 → 1.47.23
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.
|
@@ -121,7 +121,7 @@ const SearchBar = ({ lang, resultFormatter, backdrop, OverrideIcons = {}, messag
|
|
|
121
121
|
const matchingAdditionalResults = additionalResults.filter((result) => {
|
|
122
122
|
const normalizedResult = normalize(result.title.toLowerCase());
|
|
123
123
|
const normalizedText = normalize(text.toLowerCase());
|
|
124
|
-
return normalizedResult.includes(normalizedText);
|
|
124
|
+
return text && normalizedResult.includes(normalizedText);
|
|
125
125
|
});
|
|
126
126
|
const results = [...(search?.result || []), ...matchingAdditionalResults];
|
|
127
127
|
const classes = classNames("search-bar", {
|
|
@@ -158,7 +158,7 @@ const SearchBar = ({ lang, resultFormatter, backdrop, OverrideIcons = {}, messag
|
|
|
158
158
|
"search-bar__result--active": i === state.active,
|
|
159
159
|
});
|
|
160
160
|
return (_jsx(Tag, { className: classes, ...props, onClick: onClick }, `${name}-${i}`));
|
|
161
|
-
}),
|
|
161
|
+
}), results?.length === 0 && (_jsx("div", { className: "search-bar__no-result", children: message(ubloLang, "no-results", messages) }))] })] })] }));
|
|
162
162
|
};
|
|
163
163
|
export default React.memo(SearchBar);
|
|
164
164
|
function normalize(text) {
|