From 94e46ed98eb2a8e3d2d64814d8bd3a41d159aead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Despont?= Date: Tue, 26 Nov 2024 17:32:06 +0100 Subject: [PATCH] specific checks --- src/bootstrap-table.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index ff237bbb0..ecf3910f7 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -1116,11 +1116,14 @@ class BootstrapTable { } if (typeof value === 'string' || typeof value === 'number') { - if ( - (this.options.strictSearch && `${value}`.toLowerCase() === searchText) || - (this.options.regexSearch && Utils.regexCompare(value, rawSearchText)) - ) { - return true + if (this.options.strictSearch) { + if ((`${value}`).toLowerCase() === searchText) { + return true + } + } else if (this.options.regexSearch) { + if (Utils.regexCompare(value, rawSearchText)) { + return true + } } else { const largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm const matches = largerSmallerEqualsRegex.exec(this.searchText)