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

strictSearch broken since 1.19.0 #7624

Closed
sdespont opened this issue Nov 26, 2024 · 0 comments
Closed

strictSearch broken since 1.19.0 #7624

sdespont opened this issue Nov 26, 2024 · 0 comments
Labels
Bug Issues which are marked as Bug

Comments

@sdespont
Copy link
Contributor

sdespont commented Nov 26, 2024

Bootstraptable version(s) affected

>= 1.19.0

Description

strictSearch should displays only exact text. However it is no longer working since 1.19.0.

For example, inserting an “i” in the search box should not display all results.
image

Example(s)

Working with 1.18.3 : https://live.bootstrap-table.com/code/sdespont/18390
Not working 1.19.0 : https://live.bootstrap-table.com/code/sdespont/18392
Not working 1.23.5 : https://live.bootstrap-table.com/code/sdespont/18391

Possible Solutions

The code added to manage new option RegexSearch introduce the bug

1.18.3

if (typeof value === 'string' || typeof value === 'number') {
if (this.options.strictSearch) {
if ((`${value}`).toLowerCase() === s) {
return true
}

1.19.0

if (typeof value === 'string' || typeof value === 'number') {
if (
this.options.strictSearch && (`${value}`).toLowerCase() === searchText ||
(this.options.regexSearch && Utils.regexCompare(value, rawSearchText))
) {
return true
}

No response

Additional Context

No response

@sdespont sdespont added the Bug Issues which are marked as Bug label Nov 26, 2024
@sdespont sdespont mentioned this issue Nov 26, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues which are marked as Bug
Projects
None yet
Development

No branches or pull requests

2 participants