Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed searchbar suggest handler undefined input ref #4125

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fixed agent breadcrumb routing minor error [#4101](https://github.com/wazuh/wazuh-kibana-app/pull/4101)
- Fixed selected text not visible in API Console [#4102](https://github.com/wazuh/wazuh-kibana-app/pull/4102)
- Fixed the 'missing parameters' error on the Manager Logs [#4110](https://github.com/wazuh/wazuh-kibana-app/pull/4110)
- Fixed undefined input reference when switching between rule set view and rule files view [#4125](https://github.com/wazuh/wazuh-kibana-app/pull/4125)
- Fixed not found FIM file toast error #4124 [#4124](https://github.com/wazuh/wazuh-kibana-app/pull/4124)
- Fixed "See full error" on error toast [#4119](https://github.com/wazuh/wazuh-kibana-app/pull/4119)
- Fixed not being able to remove custom filters. [#4112](https://github.com/wazuh/wazuh-kibana-app/pull/4112)
Expand Down
4 changes: 3 additions & 1 deletion public/components/wz-search-bar/lib/suggest-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class SuggestHandler extends BaseHandler {
':': 'Equals',
};

constructor(props, setInputValue) {
constructor(props, setInputValue, inputRef) {
super();
this.props = props;
this.filters = props.filters;
Expand All @@ -50,6 +50,8 @@ export class SuggestHandler extends BaseHandler {
this.suggestItems = props.suggestions;
this.searchType = 'search';
this.lastCall = 0;
if (inputRef)
this.inputRef = inputRef;
}

combine = (...args) => (input) => args.reduceRight((acc, arg) => (acc = arg(acc)), input);
Expand Down
2 changes: 1 addition & 1 deletion public/components/wz-search-bar/wz-search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function useSuggestHandler(

useEffect(() => {
setHandler(
new SuggestHandler({ ...props, status, setStatus, setInvalid, setIsOpen }, setInputValue)
new SuggestHandler({ ...props, status, setStatus, setInvalid, setIsOpen }, setInputValue, inputRef)
);
!props.noDeleteFiltersOnUpdateSuggests && props.onFiltersChange([]);
}, [props.suggestions]);
Expand Down