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

[#2826]trim values before search #2844

Merged
merged 3 commits into from
Dec 12, 2023
Merged

Conversation

megumiimai
Copy link
Contributor

@megumiimai megumiimai commented Sep 2, 2023

resolved #2826

56d3809900af8d017439eda886ca7a66

Make sure to target the dev branch!

@megumiimai megumiimai changed the base branch from main to dev September 2, 2023 07:08
@megumiimai megumiimai changed the title [#2826]trim values before searching [#2826]trim values before search Sep 3, 2023
@@ -2951,6 +2951,10 @@

this.$searchbox.on('input propertychange', function () {
var searchValue = that.$searchbox[0].value;
var isWhitespace = /^\s*$/.test(searchValue);
if (!isWhitespace) {
searchValue = searchValue.replace(/^\s+|\s+$/g, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're probably okay to just use searchValue = searchValue.trim(); instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caseyjhol
thank you very much.
Since some users sometimes enter full-width spaces, so I have added support for trimming all half-width spaces and full-width spaces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha. Maybe just mention this in a brief comment above this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a comment. thank you.

@@ -2951,6 +2951,10 @@

this.$searchbox.on('input propertychange', function () {
var searchValue = that.$searchbox[0].value;
var isWhitespace = /^\s*$/.test(searchValue);
if (!isWhitespace) {
searchValue = searchValue.replace(/^\s+|\s+$/g, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha. Maybe just mention this in a brief comment above this line.

@caseyjhol caseyjhol merged commit df48b46 into snapappointments:dev Dec 12, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trim values before search in selectpicker
2 participants