diff --git a/CHANGELOG.md b/CHANGELOG.md index a0c3addd8f..a1991af679 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/public/components/wz-search-bar/lib/suggest-handler.ts b/public/components/wz-search-bar/lib/suggest-handler.ts index 8fd9f4ba05..7b9b986e8e 100644 --- a/public/components/wz-search-bar/lib/suggest-handler.ts +++ b/public/components/wz-search-bar/lib/suggest-handler.ts @@ -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; @@ -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); diff --git a/public/components/wz-search-bar/wz-search-bar.tsx b/public/components/wz-search-bar/wz-search-bar.tsx index 85c3190924..d922f9486d 100644 --- a/public/components/wz-search-bar/wz-search-bar.tsx +++ b/public/components/wz-search-bar/wz-search-bar.tsx @@ -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]);