Skip to content

Commit

Permalink
refactor: search pattern based on its title and not slug
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Oct 29, 2024
1 parent 9ec20fa commit fe75f24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/plugins/patterns-library/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const Library = ({
const currentCategory = 'favorites' === selectedCategory ? patterns.filter( pattern => getFavorites.includes( pattern.name ) ) : patterns.filter( pattern => pattern.categories.includes( selectedCategory ) );

if ( searchInput ) {
return currentCategory.filter( pattern => pattern.name.toLowerCase().includes( searchInput.toLowerCase() ) );
return currentCategory.filter( pattern => pattern.title.toLowerCase().includes( searchInput.toLowerCase() ) );
}

return currentCategory;
Expand Down

0 comments on commit fe75f24

Please sign in to comment.