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

Content manager LeftMenu (search/filter) keyword should match in whole string not from start #22492

Closed
AmmonLin opened this issue Dec 23, 2024 · 3 comments
Labels
status: will not fix Won't fix as it's either intended or for some other reason

Comments

@AmmonLin
Copy link

Bug report

Required System information

  • Node.js version: 22.12.0
  • NPM version: 9.9.3
  • Strapi version: 5.x / 4.x
  • Database: sqlite / mysql
  • Operating system: Ubuntu 20.04.6 LTS in WSL
  • Is your project Javascript or Typescript: Javascript / TypeScript

Describe the bug

When using the "Search for a content type" feature in the Content Manager, entering a keyword only lists items that start with the keyword. In general understanding, keyword searching and filtering typically means the string contains the keyword. So, I consider it a bug not a feature request and report it here.

Steps to reproduce the behavior

  1. Create three Collection/Single types as Homepage, Work From Home and About Us
  2. Go to 'Content Manager'
  3. Click on 'Magnifier Icon' on the top of LeftMenu
  4. In the shown input box type Home
  5. Only Homepage will show on the list

Expected behavior

Both Homepage and Work From Home show on the list

Screenshots

N/A

Code snippets

N/A

Additional context

Drill down into the LeftMenu.tsx

@derrickmehaffy
Copy link
Member

This is currently intended as we use containsi rather than startsWith: #20643

@derrickmehaffy derrickmehaffy added the status: will not fix Won't fix as it's either intended or for some other reason label Dec 26, 2024
@AmmonLin
Copy link
Author

Apologies for bothering you. The same issue also occurs in ContentTypeBuilderNav. Should I create another issue to report ?

drill down to L184

@derrickmehaffy
Copy link
Member

If the search is 'working' but is looking like it uses contains rather than starts with that's intended as well.

We have swapped back and forth a few times and most of users prefer contains as it's a bit easier to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: will not fix Won't fix as it's either intended or for some other reason
Projects
None yet
Development

No branches or pull requests

2 participants