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

Default displayed currency in price range filter is actually not really the default #539

Open
NicolasMahe opened this issue Jan 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@NicolasMahe
Copy link
Member

NicolasMahe commented Jan 25, 2024

On the explore page or the collection page, when I open the "price range" filter component, a currency is displayed as selected (bold) but when I directly input the min price, I can see the filter is not properly apply. The URL does not contain the currency so the filter is not applied.
If I select the currency, then the filter is correctly applied.
Also the default selected currency seems to be random, it's not the first one.

Screen.Recording.2024-01-25.at.11.56.30.mov

A simple solution could be to add a first item in the select input when currency is not select like "Select a currency". Otherwise find a way to properly select the first currency by default.


As a comparaison, a similar select input on the bid page doesn't have this issue. The first currency displayed is properly and selected as default.

@NicolasMahe NicolasMahe added the bug Something isn't working label Jan 25, 2024
@NicolasMahe NicolasMahe changed the title Default displayed currency is price range filter is actually set as default Default displayed currency in price range filter is actually set as default Jan 25, 2024
@NicolasMahe NicolasMahe changed the title Default displayed currency in price range filter is actually set as default Default displayed currency in price range filter is actually not set as default Jan 25, 2024
@NicolasMahe NicolasMahe changed the title Default displayed currency in price range filter is actually not set as default Default displayed currency in price range filter is actually not really the default Jan 25, 2024
@NicolasMahe
Copy link
Member Author

NicolasMahe commented Jan 25, 2024

It seems like the components/Select/Select.tsx is not working well when the value is an object rather than a string.

const selectedChoice = useMemo(
() => choices.find((x) => x.value === value),
[choices, value],

The comparaison x.value === value is not going to work on object or array.

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

No branches or pull requests

1 participant