diff --git a/src/components/item/ItemContent.tsx b/src/components/item/ItemContent.tsx index 9ba05c081..f7573381a 100644 --- a/src/components/item/ItemContent.tsx +++ b/src/components/item/ItemContent.tsx @@ -187,7 +187,9 @@ const FolderContent = ({ // TODO: use hook's filter when available const folderChildren = children?.filter( - (f) => shouldDisplayItem(f.type) && f.name.includes(itemSearch.text), + (f) => + shouldDisplayItem(f.type) && + f.name.toLowerCase().includes(itemSearch.text.toLowerCase()), ); if (isLoading) { diff --git a/src/components/item/ItemSearch.tsx b/src/components/item/ItemSearch.tsx index 62cbac5bc..45ac11118 100644 --- a/src/components/item/ItemSearch.tsx +++ b/src/components/item/ItemSearch.tsx @@ -2,7 +2,6 @@ import { ChangeEvent, useState } from 'react'; import { Typography } from '@mui/material'; -import { DiscriminatedItem } from '@graasp/sdk'; import { SearchInput } from '@graasp/ui'; import { useBuilderTranslation } from '../../config/i18n'; @@ -32,7 +31,6 @@ export const useItemSearch = ({ }: { onSearch?: () => void; } = {}): { - results?: DiscriminatedItem[]; text: string; input: JSX.Element; } => { @@ -41,7 +39,7 @@ export const useItemSearch = ({ const handleSearchInput = (event: ChangeEvent<{ value: string }>) => { const text = event.target.value; - setSearchText(text.toLowerCase()); + setSearchText(text); onSearch?.(); };