0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🎨 Made /-menu card searching case-insensitive

no issue

- allows typing "Button" to match the "button" card
- useful on mobile where words can be auto-capitalized
This commit is contained in:
Kevin Ansfield 2022-01-31 13:37:25 +00:00
parent e0fa64a56b
commit fa4f8221d5

View file

@ -24,7 +24,7 @@ const createItemMatcher = (query) => {
// standard exact matching for items with a matches array
if (isArray(item.matches)) {
return card ? item.matches.any(match => match.indexOf(card) === 0) : true;
return card ? item.matches.any(match => match.indexOf(card.toLowerCase()) === 0) : true;
}
// custom per-item matching, eg. snippets match any part of their title