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

Dropdown select options don't change on click on Firefox #336

Open
razvanudream opened this issue Aug 26, 2021 · 0 comments
Open

Dropdown select options don't change on click on Firefox #336

razvanudream opened this issue Aug 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@razvanudream
Copy link

Describe the bug
product-summary-sku-selector is the problem, to be more precise

` const handleClick = (_: React.MouseEvent, value: string) => {
const reducedOptions = displayOptions.reduce<Record<string, DisplayOption>>(
(acc, cur) => {
acc[cur.label] = cur

    return acc
  },
  {}
)

return reducedOptions[value].onSelectItem()

}`

The value is empty string when selected from Firefox which results in an error

Uncaught TypeError: reducedOptions[value] is undefined handleClick SelectVariationMode.tsx:63

You won't see it like this in production, but here you go from a workspace where I linked to last store-components version

https://skuselector--dacris.myvtex.com/

image

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.dacris.net/ on home page and try to select a value from the drop down (in a shelf)
  2. See error in browser

Expected behavior
The error shouldn't happen and the value should change on click

Screenshots
See above

Desktop (please complete the following information):

  • OS: Ubuntu 20.04.3 LTS
  • Browser Firefox
  • Version 91.0.2 (64-bit) Mozilla For Ubuntu (but tried it on Windows as well with a different version)

Additional context
Tried on several other production sites done on VTEX, same issue. Tried to find a solution but couldn't -> it only happens in Firefox AFAIK. Also it only happens with this block, not sku-selector, that one with the select option works fine.

I also tried installing an older version of store-components, no luck.

@razvanudream razvanudream added the bug Something isn't working label Aug 26, 2021
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