Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover: Remove duplicated filters in filter modal #836

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

Botsy
Copy link
Contributor

@Botsy Botsy commented Feb 17, 2025

This fix for Discover page shows in the filters modal only the filters that are not visible as a dropdown above the results. Also fixes the spacing issue of the filter button on larger screens with more than 3 filters.

@Botsy Botsy changed the title Discover Discover: Remove duplicated catalog type filter on mobile Feb 17, 2025
@Botsy Botsy self-assigned this Feb 17, 2025
@Botsy Botsy added the bug Something isn't working label Feb 17, 2025
@Botsy Botsy added this to the v5.0.0-beta.19 milestone Feb 17, 2025
@Botsy Botsy requested review from tymmesyde and kKaskak February 17, 2025 12:17
@Botsy Botsy marked this pull request as draft February 17, 2025 12:24
@Botsy Botsy changed the title Discover: Remove duplicated catalog type filter on mobile Discover: Remove duplicated filters in filter modal Feb 18, 2025
@Botsy Botsy marked this pull request as ready for review February 18, 2025 14:12
Comment on lines -13 to -22
const Multiselect = ({ className, mode, direction, title, disabled, dataset, renderLabelContent, renderLabelText, onOpen, onClose, onSelect, ...props }) => {
const Multiselect = ({ className, mode, direction, title, disabled, dataset, options, renderLabelContent, renderLabelText, onOpen, onClose, onSelect, ...props }) => {
const [menuOpen, , closeMenu, toggleMenu] = useBinaryState(false);
const options = React.useMemo(() => {
return Array.isArray(props.options) ?
props.options.filter((option) => {
const filteredOptions = React.useMemo(() => {
return Array.isArray(options) ?
options.filter((option) => {
return option && (typeof option.value === 'string' || option.value === null);
})
:
[];
}, [props.options]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I destructured the options from the props because they were being unnecessarily rendered in the html as props in the elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants