From 2da83c27aafff7a051c921b61e3f05ff4c17778f Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Tue, 20 Sep 2022 14:37:44 +0300 Subject: [PATCH] [oform] Bug 59069 --- apps/documenteditor/forms/app/controller/SearchBar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/forms/app/controller/SearchBar.js b/apps/documenteditor/forms/app/controller/SearchBar.js index 53ce27e4f..2465a8466 100644 --- a/apps/documenteditor/forms/app/controller/SearchBar.js +++ b/apps/documenteditor/forms/app/controller/SearchBar.js @@ -127,7 +127,7 @@ define([ onInputSearchChange: function (text) { var text = text[0]; - if (this._state.searchText !== text) { + if ((text && this._state.searchText !== text) || (!text && this._state.newSearchText)) { this._state.newSearchText = text; this._lastInputChange = (new Date()); if (this._searchTimer === undefined) { @@ -136,7 +136,11 @@ define([ if ((new Date()) - me._lastInputChange < 400) return; me._state.searchText = me._state.newSearchText; - (me._state.newSearchText !== '') && me.onQuerySearch(); + if (me._state.newSearchText !== '') { + me.onQuerySearch(); + } else { + me.api.asc_endFindText(); + } clearInterval(me._searchTimer); me._searchTimer = undefined; }, 10);