Merge pull request #1982 from ONLYOFFICE/fix/bug_59069

Fix/bug 59069
This commit is contained in:
maxkadushkin 2022-09-26 13:58:38 +03:00 committed by GitHub
commit 1c6e028da6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);