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

fix: Issue with searchPredicate function second argument(searchTerm) #448

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

manish-dalal
Copy link

@manish-dalal manish-dalal commented Nov 27, 2020

What does it do?

An issue with searchPredicate function second argument(searchTerm). Always received lowercase of search string. Needed the actual search string that is typed by a user.
Please check the issue on given eg:- react-dropdown-tree-select-searchpredicate-issue

Fixes # (issue)

Updated position of converting searchTerm to lowercase.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • Updated documentation (if applicable)
  • Added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My changes generate no new warnings

@codeclimate
Copy link

codeclimate bot commented Nov 27, 2020

Code Climate has analyzed commit c80eef5 and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1530

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.901%

Totals Coverage Status
Change from base Build 1526: 0.0%
Covered Lines: 598
Relevant Lines: 619

💛 - Coveralls

@mrchief
Copy link
Collaborator

mrchief commented Dec 1, 2020

@manish-dalal thanks for the CodeSandbox and the PR. Trying to understand the actual issue here: are you trying to make sure the "Searched String" label shows the search string as user typed it?

image

Or is it that search is broken somehow?

@manish-dalal
Copy link
Author

@mrchief thanks for the reply. I just want to implement case sensitive searching using searchPredicate props. On searchPredicate second argument(searchTerm), we are getting the actual string typed by the user. And currently, it is always the lowercase of the actual string. So I need the actual string, not the lowercase of that. For more clarification, I also updated the CodeSandbox example, please check react-dropdown-tree-select-searchpredicate-issue

@mrchief
Copy link
Collaborator

mrchief commented Dec 2, 2020

So if I understand correctly, when you search for acc, Acc shouldn't show up and vice versa

image

And that doesn't work as searchPredicate receives lowercased version of the search string, correct?
image

@manish-dalal
Copy link
Author

Correct

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@mrchief mrchief added wip Work In Progress and removed stale labels Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants