huntabyte / cmdk-sv

cmdk, but for Svelte ✨
https://cmdk-sv.com
MIT License
410 stars 17 forks source link

Feature request: Use different value for searching and highlighting #52

Closed Scooter1337 closed 5 months ago

Scooter1337 commented 5 months ago
  1. I want to search by name so in this case {team.name}
  2. Team names are not unique, so if i hover over "Team 1", the other "Team 1" is also highlighted
  3. Setting the value to {team.uuid} breaks the search option.
Scooter1337 commented 5 months ago

I've currently solved this by appending '%'.repeat(index) to the value where % is any character that is not allowed in the team name, which makes them all unique. Not a good solution when the lists get longer, as appending will get slower.

huntabyte commented 5 months ago

You need unique values to search by.