Fix bug IconPicker

This commit is contained in:
Charles Bochet
2023-12-14 14:41:51 +01:00
parent fd3b7ccd9a
commit 73e03dd0c4

View File

@ -95,18 +95,20 @@ export const IconPicker = ({
const { closeDropdown } = useDropdown({ dropdownScopeId }); const { closeDropdown } = useDropdown({ dropdownScopeId });
const { getIcons, getIcon } = useIcons(); const { getIcons, getIcon } = useIcons();
const { icons } = getIcons(); const icons = getIcons();
const iconKeys = useMemo(() => { const iconKeys = useMemo(() => {
const filteredIconKeys = Object.keys(icons).filter((iconKey) => { const filteredIconKeys = icons
return ( ? Object.keys(icons).filter((iconKey) => {
iconKey !== selectedIconKey && return (
(!searchString || iconKey !== selectedIconKey &&
[iconKey, convertIconKeyToLabel(iconKey)].some((label) => (!searchString ||
label.toLowerCase().includes(searchString.toLowerCase()), [iconKey, convertIconKeyToLabel(iconKey)].some((label) =>
)) label.toLowerCase().includes(searchString.toLowerCase()),
); ))
}); );
})
: [];
return ( return (
selectedIconKey selectedIconKey