pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.42k stars 265 forks source link

Unexpected matching behavior #55

Closed Kilian closed 1 year ago

Kilian commented 1 year ago

Reproduction steps:

  1. On https://cmdk.paco.me/ make sure you have the raycast example selected
  2. Type "eee"
  3. See "Manage Extensions" still being visible even though it does not contain the string "eee"
  4. Type "eeee"
  5. See the list is now empty

I would expect input to match sequentially e.g. if there is no "eee" in the label, it should not match. It looks like right now each character is matched individually-but-uniquely, since "manage extensions" contains three non-sequential "e"s.

pacocoursey commented 1 year ago

This is expected fuzzy matching behavior from the library used, command-score. You can override the logic by passing the filter prop: https://github.com/pacocoursey/cmdk#command-cmdk-root